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

Side by Side Diff: chrome/browser/notifications/desktop_notification_service.cc

Issue 1102353003: [chrome/browser/notifications] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/notifications/desktop_notification_service_factory.cc » ('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) 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 "chrome/browser/notifications/desktop_notification_service.h" 5 #include "chrome/browser/notifications/desktop_notification_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/prefs/scoped_user_pref_update.h" 10 #include "base/prefs/scoped_user_pref_update.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 DesktopNotificationService::~DesktopNotificationService() { 87 DesktopNotificationService::~DesktopNotificationService() {
88 } 88 }
89 89
90 void DesktopNotificationService::RequestNotificationPermission( 90 void DesktopNotificationService::RequestNotificationPermission(
91 content::WebContents* web_contents, 91 content::WebContents* web_contents,
92 const PermissionRequestID& request_id, 92 const PermissionRequestID& request_id,
93 const GURL& requesting_origin, 93 const GURL& requesting_origin,
94 bool user_gesture, 94 bool user_gesture,
95 const BrowserPermissionCallback& result_callback) { 95 const BrowserPermissionCallback& result_callback) {
96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 96 DCHECK_CURRENTLY_ON(BrowserThread::UI);
97 97
98 #if defined(ENABLE_EXTENSIONS) 98 #if defined(ENABLE_EXTENSIONS)
99 extensions::InfoMap* extension_info_map = 99 extensions::InfoMap* extension_info_map =
100 extensions::ExtensionSystem::Get(profile_)->info_map(); 100 extensions::ExtensionSystem::Get(profile_)->info_map();
101 const extensions::Extension* extension = NULL; 101 const extensions::Extension* extension = NULL;
102 if (extension_info_map) { 102 if (extension_info_map) {
103 extensions::ExtensionSet extensions; 103 extensions::ExtensionSet extensions;
104 extension_info_map->GetExtensionsWithAPIPermissionForSecurityOrigin( 104 extension_info_map->GetExtensionsWithAPIPermissionForSecurityOrigin(
105 requesting_origin, 105 requesting_origin,
106 request_id.render_process_id(), 106 request_id.render_process_id(),
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // Tell the IO thread that this extension's permission for notifications 272 // Tell the IO thread that this extension's permission for notifications
273 // has changed. 273 // has changed.
274 extensions::InfoMap* extension_info_map = 274 extensions::InfoMap* extension_info_map =
275 extensions::ExtensionSystem::Get(profile_)->info_map(); 275 extensions::ExtensionSystem::Get(profile_)->info_map();
276 BrowserThread::PostTask( 276 BrowserThread::PostTask(
277 BrowserThread::IO, FROM_HERE, 277 BrowserThread::IO, FROM_HERE,
278 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, 278 base::Bind(&extensions::InfoMap::SetNotificationsDisabled,
279 extension_info_map, notifier_id.id, !enabled)); 279 extension_info_map, notifier_id.id, !enabled));
280 #endif 280 #endif
281 } 281 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/notifications/desktop_notification_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698