Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: trunk/src/content/renderer/notification_provider.cc

Issue 181113009: Revert 253010 "Revert 251563 "Move browser initiated navigation ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/notification_provider.h" 5 #include "content/renderer/notification_provider.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "content/common/desktop_notification_messages.h" 8 #include "content/common/desktop_notification_messages.h"
9 #include "content/common/view_messages.h" 9 #include "content/common/frame_messages.h"
10 #include "content/renderer/render_view_impl.h" 10 #include "content/renderer/render_view_impl.h"
11 #include "third_party/WebKit/public/platform/WebURL.h" 11 #include "third_party/WebKit/public/platform/WebURL.h"
12 #include "third_party/WebKit/public/web/WebDocument.h" 12 #include "third_party/WebKit/public/web/WebDocument.h"
13 #include "third_party/WebKit/public/web/WebFrame.h" 13 #include "third_party/WebKit/public/web/WebFrame.h"
14 #include "third_party/WebKit/public/web/WebNotificationPermissionCallback.h" 14 #include "third_party/WebKit/public/web/WebNotificationPermissionCallback.h"
15 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" 15 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
16 #include "third_party/WebKit/public/web/WebView.h" 16 #include "third_party/WebKit/public/web/WebView.h"
17 17
18 using blink::WebDocument; 18 using blink::WebDocument;
19 using blink::WebNotification; 19 using blink::WebNotification;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 IPC_BEGIN_MESSAGE_MAP(NotificationProvider, message) 94 IPC_BEGIN_MESSAGE_MAP(NotificationProvider, message)
95 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostDisplay, OnDisplay); 95 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostDisplay, OnDisplay);
96 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostError, OnError); 96 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostError, OnError);
97 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostClose, OnClose); 97 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostClose, OnClose);
98 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostClick, OnClick); 98 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostClick, OnClick);
99 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PermissionRequestDone, 99 IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PermissionRequestDone,
100 OnPermissionRequestComplete); 100 OnPermissionRequestComplete);
101 IPC_MESSAGE_UNHANDLED(handled = false) 101 IPC_MESSAGE_UNHANDLED(handled = false)
102 IPC_END_MESSAGE_MAP() 102 IPC_END_MESSAGE_MAP()
103 103
104 if (message.type() == ViewMsg_Navigate::ID) 104 if (message.type() == FrameMsg_Navigate::ID)
105 OnNavigate(); // Don't want to swallow the message. 105 OnNavigate(); // Don't want to swallow the message.
106 106
107 return handled; 107 return handled;
108 } 108 }
109 109
110 void NotificationProvider::OnDisplay(int id) { 110 void NotificationProvider::OnDisplay(int id) {
111 WebNotification notification; 111 WebNotification notification;
112 bool found = manager_.GetNotification(id, &notification); 112 bool found = manager_.GetNotification(id, &notification);
113 // |found| may be false if the WebNotification went out of scope in 113 // |found| may be false if the WebNotification went out of scope in
114 // the page before it was actually displayed to the user. 114 // the page before it was actually displayed to the user.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 DCHECK(callback); 150 DCHECK(callback);
151 callback->permissionRequestComplete(); 151 callback->permissionRequestComplete();
152 manager_.OnPermissionRequestComplete(id); 152 manager_.OnPermissionRequestComplete(id);
153 } 153 }
154 154
155 void NotificationProvider::OnNavigate() { 155 void NotificationProvider::OnNavigate() {
156 manager_.Clear(); 156 manager_.Clear();
157 } 157 }
158 158
159 } // namespace content 159 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/renderer/devtools/devtools_agent.cc ('k') | trunk/src/content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698