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

Unified Diff: chrome/browser/notifications/message_center_settings_controller.h

Issue 2064363002: Refactor MessageCenterSettingsController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto associated CL. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/message_center_settings_controller.h
diff --git a/chrome/browser/notifications/message_center_settings_controller.h b/chrome/browser/notifications/message_center_settings_controller.h
index d25c2408b9b61de73c0d5e3bba78f54c1876c08e..b673dea5938c27876c50d28f5ad711fd1e936698 100644
--- a/chrome/browser/notifications/message_center_settings_controller.h
+++ b/chrome/browser/notifications/message_center_settings_controller.h
@@ -30,12 +30,7 @@
#endif
class Profile;
-
-#if defined(OS_CHROMEOS)
-namespace arc {
-class ArcNotifierManager;
-}
-#endif
+class NotifierSource;
namespace base {
class CancelableTaskTracker;
@@ -58,7 +53,7 @@ class MessageCenterSettingsController
#if defined(OS_CHROMEOS)
public user_manager::UserManager::UserSessionStateObserver,
#endif
- public AppIconLoaderDelegate {
+ public message_center::NotifierSettingsObserver {
public:
explicit MessageCenterSettingsController(
ProfileAttributesStorage& profile_attributes_storage);
@@ -90,17 +85,13 @@ class MessageCenterSettingsController
void ActiveUserChanged(const user_manager::User* active_user) override;
#endif
- // Overridden from AppIconLoaderDelegate.
- void OnAppImageUpdated(const std::string& id,
- const gfx::ImageSkia& image) override;
-
private:
// Overridden from content::NotificationObserver.
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
- // ProfileAttributesStorage::Observer:
+ // Overridden from ProfileAttributesStorage::Observer.
void OnProfileAdded(const base::FilePath& profile_path) override;
void OnProfileWasRemoved(const base::FilePath& profile_path,
const base::string16& profile_name) override;
@@ -108,8 +99,11 @@ class MessageCenterSettingsController
const base::string16& old_profile_name) override;
void OnProfileAuthInfoChanged(const base::FilePath& profile_path) override;
- void OnFaviconLoaded(const GURL& url,
- const favicon_base::FaviconImageResult& favicon_result);
+ // Overridden from message_center::NotifierSettingsObserver.
dewittj 2016/06/16 19:45:36 While I agree that pulling these out is a nice thi
+ void UpdateIconImage(const message_center::NotifierId&,
+ const gfx::Image&) override;
+ void NotifierGroupChanged() override;
+ void NotifierEnabledChanged(const message_center::NotifierId&, bool) override;
#if defined(OS_CHROMEOS)
// Sets up the notifier group for the guest session. This needs to be
@@ -126,23 +120,17 @@ class MessageCenterSettingsController
// The views displaying notifier settings.
base::ObserverList<message_center::NotifierSettingsObserver> observers_;
- // The task tracker for loading favicons.
- std::unique_ptr<base::CancelableTaskTracker> favicon_tracker_;
-
- std::unique_ptr<AppIconLoader> app_icon_loader_;
-
-#if defined(OS_CHROMEOS)
- std::unique_ptr<arc::ArcNotifierManager> arc_notifier_manager_;
-#endif
-
- std::map<base::string16, ContentSettingsPattern> patterns_;
-
// The list of all configurable notifier groups. This is each profile that is
// loaded (and in the ProfileAttributesStorage - so no incognito profiles go
// here).
std::vector<std::unique_ptr<message_center::ProfileNotifierGroup>>
notifier_groups_;
+ // Notifier source for each notifier type.
+ std::map<message_center::NotifierId::NotifierType,
+ std::unique_ptr<NotifierSource>>
+ sources_;
+
size_t current_notifier_group_;
content::NotificationRegistrar registrar_;

Powered by Google App Engine
This is Rietveld 408576698