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

Side by Side Diff: chrome/browser/notifications/message_center_settings_controller.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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_settings_controller.h" 5 #include "chrome/browser/notifications/message_center_settings_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/string_compare.h" 10 #include "base/i18n/string_compare.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 } else { 364 } else {
365 notification_service->SetNotifierEnabled(notifier.notifier_id, enabled); 365 notification_service->SetNotifierEnabled(notifier.notifier_id, enabled);
366 if (notifier.notifier_id.type == NotifierId::SYNCED_NOTIFICATION_SERVICE) { 366 if (notifier.notifier_id.type == NotifierId::SYNCED_NOTIFICATION_SERVICE) {
367 notifier::ChromeNotifierService* notifier_service = 367 notifier::ChromeNotifierService* notifier_service =
368 notifier::ChromeNotifierServiceFactory::GetInstance()->GetForProfile( 368 notifier::ChromeNotifierServiceFactory::GetInstance()->GetForProfile(
369 profile, Profile::EXPLICIT_ACCESS); 369 profile, Profile::EXPLICIT_ACCESS);
370 notifier_service->OnSyncedNotificationServiceEnabled( 370 notifier_service->OnSyncedNotificationServiceEnabled(
371 notifier.notifier_id.id, enabled); 371 notifier.notifier_id.id, enabled);
372 } 372 }
373 } 373 }
374 FOR_EACH_OBSERVER(message_center::NotifierSettingsObserver,
375 observers_,
376 NotifierEnabledChanged(notifier.notifier_id, enabled));
374 } 377 }
375 378
376 void MessageCenterSettingsController::OnNotifierSettingsClosing() { 379 void MessageCenterSettingsController::OnNotifierSettingsClosing() {
377 DCHECK(favicon_tracker_.get()); 380 DCHECK(favicon_tracker_.get());
378 favicon_tracker_->TryCancelAll(); 381 favicon_tracker_->TryCancelAll();
379 patterns_.clear(); 382 patterns_.clear();
380 } 383 }
381 384
382 bool MessageCenterSettingsController::NotifierHasAdvancedSettings( 385 bool MessageCenterSettingsController::NotifierHasAdvancedSettings(
383 const NotifierId& notifier_id) const { 386 const NotifierId& notifier_id) const {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 // creating a primary profile, and causes an infinite loop. 541 // creating a primary profile, and causes an infinite loop.
539 // Thus, it would be better to delay creating group for guest login. 542 // Thus, it would be better to delay creating group for guest login.
540 base::MessageLoopProxy::current()->PostTask( 543 base::MessageLoopProxy::current()->PostTask(
541 FROM_HERE, 544 FROM_HERE,
542 base::Bind( 545 base::Bind(
543 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin, 546 &MessageCenterSettingsController::CreateNotifierGroupForGuestLogin,
544 weak_factory_.GetWeakPtr())); 547 weak_factory_.GetWeakPtr()));
545 } 548 }
546 #endif 549 #endif
547 } 550 }
OLDNEW
« no previous file with comments | « chrome/browser/notifications/message_center_notification_manager.cc ('k') | ui/message_center/cocoa/settings_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698