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

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

Issue 8312005: Ignore paths when matching patterns for extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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
« no previous file with comments | « content/renderer/notification_provider.h ('k') | content/shell/shell_content_browser_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/string_util.h" 7 #include "base/string_util.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "content/common/desktop_notification_messages.h" 9 #include "content/common/desktop_notification_messages.h"
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 void NotificationProvider::objectDestroyed( 50 void NotificationProvider::objectDestroyed(
51 const WebNotification& notification) { 51 const WebNotification& notification) {
52 int id; 52 int id;
53 bool id_found = manager_.GetId(notification, id); 53 bool id_found = manager_.GetId(notification, id);
54 // Won't be found if the notification has already been closed by the user. 54 // Won't be found if the notification has already been closed by the user.
55 if (id_found) 55 if (id_found)
56 manager_.UnregisterNotification(id); 56 manager_.UnregisterNotification(id);
57 } 57 }
58 58
59 WebNotificationPresenter::Permission NotificationProvider::checkPermission( 59 WebNotificationPresenter::Permission NotificationProvider::checkPermission(
60 const WebURL& url) { 60 const WebURL& origin) {
61 int permission; 61 int permission;
62 Send(new DesktopNotificationHostMsg_CheckPermission( 62 Send(new DesktopNotificationHostMsg_CheckPermission(
63 routing_id(), 63 routing_id(),
64 url, 64 origin,
65 &permission)); 65 &permission));
66 return static_cast<WebNotificationPresenter::Permission>(permission); 66 return static_cast<WebNotificationPresenter::Permission>(permission);
67 } 67 }
68 68
69 void NotificationProvider::requestPermission( 69 void NotificationProvider::requestPermission(
70 const WebSecurityOrigin& origin, 70 const WebSecurityOrigin& origin,
71 WebNotificationPermissionCallback* callback) { 71 WebNotificationPermissionCallback* callback) {
72 // We only request permission in response to a user gesture. 72 // We only request permission in response to a user gesture.
73 if (!render_view()->GetWebView()->mainFrame()->isProcessingUserGesture()) 73 if (!render_view()->GetWebView()->mainFrame()->isProcessingUserGesture())
74 return; 74 return;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 void NotificationProvider::OnPermissionRequestComplete(int id) { 167 void NotificationProvider::OnPermissionRequestComplete(int id) {
168 WebNotificationPermissionCallback* callback = manager_.GetCallback(id); 168 WebNotificationPermissionCallback* callback = manager_.GetCallback(id);
169 DCHECK(callback); 169 DCHECK(callback);
170 callback->permissionRequestComplete(); 170 callback->permissionRequestComplete();
171 manager_.OnPermissionRequestComplete(id); 171 manager_.OnPermissionRequestComplete(id);
172 } 172 }
173 173
174 void NotificationProvider::OnNavigate() { 174 void NotificationProvider::OnNavigate() {
175 manager_.Clear(); 175 manager_.Clear();
176 } 176 }
OLDNEW
« no previous file with comments | « content/renderer/notification_provider.h ('k') | content/shell/shell_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698