OLD | NEW |
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 #ifndef CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_SETTINGS_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_SETTINGS_CONTROLLER_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_SETTINGS_CONTROLLER_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_SETTINGS_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class MessageCenterSettingsController | 46 class MessageCenterSettingsController |
47 : public message_center::NotifierSettingsProvider, | 47 : public message_center::NotifierSettingsProvider, |
48 public content::NotificationObserver, | 48 public content::NotificationObserver, |
49 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
50 public user_manager::UserManager::UserSessionStateObserver, | 50 public user_manager::UserManager::UserSessionStateObserver, |
51 #endif | 51 #endif |
52 public extensions::AppIconLoader::Delegate { | 52 public extensions::AppIconLoader::Delegate { |
53 public: | 53 public: |
54 explicit MessageCenterSettingsController( | 54 explicit MessageCenterSettingsController( |
55 ProfileInfoCache* profile_info_cache); | 55 ProfileInfoCache* profile_info_cache); |
56 virtual ~MessageCenterSettingsController(); | 56 ~MessageCenterSettingsController() override; |
57 | 57 |
58 // Overridden from message_center::NotifierSettingsProvider. | 58 // Overridden from message_center::NotifierSettingsProvider. |
59 virtual void AddObserver( | 59 void AddObserver(message_center::NotifierSettingsObserver* observer) override; |
| 60 void RemoveObserver( |
60 message_center::NotifierSettingsObserver* observer) override; | 61 message_center::NotifierSettingsObserver* observer) override; |
61 virtual void RemoveObserver( | 62 size_t GetNotifierGroupCount() const override; |
62 message_center::NotifierSettingsObserver* observer) override; | 63 const message_center::NotifierGroup& GetNotifierGroupAt( |
63 virtual size_t GetNotifierGroupCount() const override; | |
64 virtual const message_center::NotifierGroup& GetNotifierGroupAt( | |
65 size_t index) const override; | 64 size_t index) const override; |
66 virtual bool IsNotifierGroupActiveAt(size_t index) const override; | 65 bool IsNotifierGroupActiveAt(size_t index) const override; |
67 virtual void SwitchToNotifierGroup(size_t index) override; | 66 void SwitchToNotifierGroup(size_t index) override; |
68 virtual const message_center::NotifierGroup& GetActiveNotifierGroup() const | 67 const message_center::NotifierGroup& GetActiveNotifierGroup() const override; |
69 override; | 68 void GetNotifierList( |
70 virtual void GetNotifierList( | |
71 std::vector<message_center::Notifier*>* notifiers) override; | 69 std::vector<message_center::Notifier*>* notifiers) override; |
72 virtual void SetNotifierEnabled(const message_center::Notifier& notifier, | 70 void SetNotifierEnabled(const message_center::Notifier& notifier, |
73 bool enabled) override; | 71 bool enabled) override; |
74 virtual void OnNotifierSettingsClosing() override; | 72 void OnNotifierSettingsClosing() override; |
75 virtual bool NotifierHasAdvancedSettings( | 73 bool NotifierHasAdvancedSettings( |
76 const message_center::NotifierId& notifier_id) const override; | 74 const message_center::NotifierId& notifier_id) const override; |
77 virtual void OnNotifierAdvancedSettingsRequested( | 75 void OnNotifierAdvancedSettingsRequested( |
78 const message_center::NotifierId& notifier_id, | 76 const message_center::NotifierId& notifier_id, |
79 const std::string* notification_id) override; | 77 const std::string* notification_id) override; |
80 | 78 |
81 #if defined(OS_CHROMEOS) | 79 #if defined(OS_CHROMEOS) |
82 // Overridden from user_manager::UserManager::UserSessionStateObserver. | 80 // Overridden from user_manager::UserManager::UserSessionStateObserver. |
83 virtual void ActiveUserChanged( | 81 virtual void ActiveUserChanged( |
84 const user_manager::User* active_user) override; | 82 const user_manager::User* active_user) override; |
85 #endif | 83 #endif |
86 | 84 |
87 // Overridden from extensions::AppIconLoader::Delegate. | 85 // Overridden from extensions::AppIconLoader::Delegate. |
88 virtual void SetAppImage(const std::string& id, | 86 void SetAppImage(const std::string& id, const gfx::ImageSkia& image) override; |
89 const gfx::ImageSkia& image) override; | |
90 | 87 |
91 private: | 88 private: |
92 // Overridden from content::NotificationObserver. | 89 // Overridden from content::NotificationObserver. |
93 virtual void Observe(int type, | 90 void Observe(int type, |
94 const content::NotificationSource& source, | 91 const content::NotificationSource& source, |
95 const content::NotificationDetails& details) override; | 92 const content::NotificationDetails& details) override; |
96 | 93 |
97 void OnFaviconLoaded(const GURL& url, | 94 void OnFaviconLoaded(const GURL& url, |
98 const favicon_base::FaviconImageResult& favicon_result); | 95 const favicon_base::FaviconImageResult& favicon_result); |
99 | 96 |
100 #if defined(OS_CHROMEOS) | 97 #if defined(OS_CHROMEOS) |
101 // Sets up the notifier group for the guest session. This needs to be | 98 // Sets up the notifier group for the guest session. This needs to be |
102 // separated from RebuildNotifierGroup() and called asynchronously to avoid | 99 // separated from RebuildNotifierGroup() and called asynchronously to avoid |
103 // the infinite loop of creating profile. See more the comment of | 100 // the infinite loop of creating profile. See more the comment of |
104 // RebuildNotifierGroups(). | 101 // RebuildNotifierGroups(). |
105 void CreateNotifierGroupForGuestLogin(); | 102 void CreateNotifierGroupForGuestLogin(); |
(...skipping 19 matching lines...) Expand all Loading... |
125 content::NotificationRegistrar registrar_; | 122 content::NotificationRegistrar registrar_; |
126 | 123 |
127 ProfileInfoCache* profile_info_cache_; | 124 ProfileInfoCache* profile_info_cache_; |
128 | 125 |
129 base::WeakPtrFactory<MessageCenterSettingsController> weak_factory_; | 126 base::WeakPtrFactory<MessageCenterSettingsController> weak_factory_; |
130 | 127 |
131 DISALLOW_COPY_AND_ASSIGN(MessageCenterSettingsController); | 128 DISALLOW_COPY_AND_ASSIGN(MessageCenterSettingsController); |
132 }; | 129 }; |
133 | 130 |
134 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_SETTINGS_CONTROLLER_H_ | 131 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_SETTINGS_CONTROLLER_H_ |
OLD | NEW |