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

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

Issue 344763002: Rename notification_id() to disambiguate its meaning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 6 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/message_center_notification_manager.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/prefs/scoped_user_pref_update.h" 9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 const base::string16& title, 376 const base::string16& title,
377 const base::string16& message, 377 const base::string16& message,
378 const gfx::Image& icon, 378 const gfx::Image& icon,
379 const base::string16& replace_id, 379 const base::string16& replace_id,
380 NotificationDelegate* delegate, 380 NotificationDelegate* delegate,
381 Profile* profile) { 381 Profile* profile) {
382 Notification notification(origin_url, icon, title, message, 382 Notification notification(origin_url, icon, title, message,
383 blink::WebTextDirectionDefault, 383 blink::WebTextDirectionDefault,
384 base::string16(), replace_id, delegate); 384 base::string16(), replace_id, delegate);
385 g_browser_process->notification_ui_manager()->Add(notification, profile); 385 g_browser_process->notification_ui_manager()->Add(notification, profile);
386 return notification.notification_id(); 386 return notification.delegate_id();
387 } 387 }
388 388
389 DesktopNotificationService::DesktopNotificationService( 389 DesktopNotificationService::DesktopNotificationService(
390 Profile* profile, 390 Profile* profile,
391 NotificationUIManager* ui_manager) 391 NotificationUIManager* ui_manager)
392 : profile_(profile), 392 : profile_(profile),
393 ui_manager_(ui_manager) { 393 ui_manager_(ui_manager) {
394 OnStringListPrefChanged( 394 OnStringListPrefChanged(
395 prefs::kMessageCenterDisabledExtensionIds, &disabled_extension_ids_); 395 prefs::kMessageCenterDisabledExtensionIds, &disabled_extension_ids_);
396 OnStringListPrefChanged( 396 OnStringListPrefChanged(
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 // Tell the IO thread that this extension's permission for notifications 752 // Tell the IO thread that this extension's permission for notifications
753 // has changed. 753 // has changed.
754 extensions::InfoMap* extension_info_map = 754 extensions::InfoMap* extension_info_map =
755 extensions::ExtensionSystem::Get(profile_)->info_map(); 755 extensions::ExtensionSystem::Get(profile_)->info_map();
756 BrowserThread::PostTask( 756 BrowserThread::PostTask(
757 BrowserThread::IO, FROM_HERE, 757 BrowserThread::IO, FROM_HERE,
758 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, 758 base::Bind(&extensions::InfoMap::SetNotificationsDisabled,
759 extension_info_map, notifier_id.id, !enabled)); 759 extension_info_map, notifier_id.id, !enabled));
760 #endif 760 #endif
761 } 761 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/notifications/message_center_notification_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698