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

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

Issue 288033014: Remove Notifications Associated with an Extension When the Extension is Unchecked from the Message … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Unit Test That Left Dangling Pointer Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/notifications/message_center_settings_controller.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/message_center_notification_manager.h" 5 #include "chrome/browser/notifications/message_center_notification_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // On Windows, Linux and Mac, the notification manager owns the tray icon and 82 // On Windows, Linux and Mac, the notification manager owns the tray icon and
83 // views.Other platforms have global ownership and Create will return NULL. 83 // views.Other platforms have global ownership and Create will return NULL.
84 tray_.reset(message_center::CreateMessageCenterTray()); 84 tray_.reset(message_center::CreateMessageCenterTray());
85 #endif 85 #endif
86 registrar_.Add(this, 86 registrar_.Add(this,
87 chrome::NOTIFICATION_FULLSCREEN_CHANGED, 87 chrome::NOTIFICATION_FULLSCREEN_CHANGED,
88 content::NotificationService::AllSources()); 88 content::NotificationService::AllSources());
89 } 89 }
90 90
91 MessageCenterNotificationManager::~MessageCenterNotificationManager() { 91 MessageCenterNotificationManager::~MessageCenterNotificationManager() {
92 message_center_->SetNotifierSettingsProvider(NULL);
92 message_center_->RemoveObserver(this); 93 message_center_->RemoveObserver(this);
93 } 94 }
94 95
95 void MessageCenterNotificationManager::RegisterPrefs( 96 void MessageCenterNotificationManager::RegisterPrefs(
96 PrefRegistrySimple* registry) { 97 PrefRegistrySimple* registry) {
97 registry->RegisterBooleanPref(prefs::kMessageCenterShowedFirstRunBalloon, 98 registry->RegisterBooleanPref(prefs::kMessageCenterShowedFirstRunBalloon,
98 false); 99 false);
99 registry->RegisterBooleanPref(prefs::kMessageCenterShowIcon, true); 100 registry->RegisterBooleanPref(prefs::kMessageCenterShowIcon, true);
100 registry->RegisterBooleanPref(prefs::kMessageCenterForcedOnTaskbar, false); 101 registry->RegisterBooleanPref(prefs::kMessageCenterForcedOnTaskbar, false);
101 } 102 }
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 494
494 MessageCenterNotificationManager::ProfileNotification* 495 MessageCenterNotificationManager::ProfileNotification*
495 MessageCenterNotificationManager::FindProfileNotification( 496 MessageCenterNotificationManager::FindProfileNotification(
496 const std::string& id) const { 497 const std::string& id) const {
497 NotificationMap::const_iterator iter = profile_notifications_.find(id); 498 NotificationMap::const_iterator iter = profile_notifications_.find(id);
498 if (iter == profile_notifications_.end()) 499 if (iter == profile_notifications_.end())
499 return NULL; 500 return NULL;
500 501
501 return (*iter).second; 502 return (*iter).second;
502 } 503 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/notifications/message_center_settings_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698