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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "chrome/browser/extensions/app_icon_loader.h" | 16 #include "chrome/browser/extensions/app_icon_loader.h" |
17 #include "chrome/common/content_settings.h" | 17 #include "chrome/common/content_settings.h" |
18 #include "components/favicon_base/favicon_types.h" | 18 #include "components/favicon_base/favicon_types.h" |
19 #include "content/public/browser/notification_details.h" | 19 #include "content/public/browser/notification_details.h" |
20 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
22 #include "content/public/browser/notification_source.h" | 22 #include "content/public/browser/notification_source.h" |
23 #include "ui/message_center/notifier_settings.h" | 23 #include "ui/message_center/notifier_settings.h" |
24 | 24 |
25 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
26 #include "chrome/browser/chromeos/login/users/user_manager.h" | 26 #include "components/user_manager/user_manager.h" |
27 #endif | 27 #endif |
28 | 28 |
29 class Profile; | 29 class Profile; |
30 class ProfileInfoCache; | 30 class ProfileInfoCache; |
31 | 31 |
32 namespace base { | 32 namespace base { |
33 class CancelableTaskTracker; | 33 class CancelableTaskTracker; |
34 } | 34 } |
35 | 35 |
36 namespace favicon_base { | 36 namespace favicon_base { |
37 struct FaviconImageResult; | 37 struct FaviconImageResult; |
38 } | 38 } |
39 | 39 |
40 namespace message_center { | 40 namespace message_center { |
41 class ProfileNotifierGroup; | 41 class ProfileNotifierGroup; |
42 } | 42 } |
43 | 43 |
44 // The class to bridge between the settings UI of notifiers and the preference | 44 // The class to bridge between the settings UI of notifiers and the preference |
45 // storage. | 45 // storage. |
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 chromeos::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 virtual ~MessageCenterSettingsController(); |
57 | 57 |
58 // Overridden from message_center::NotifierSettingsProvider. | 58 // Overridden from message_center::NotifierSettingsProvider. |
59 virtual void AddObserver( | 59 virtual void AddObserver( |
60 message_center::NotifierSettingsObserver* observer) OVERRIDE; | 60 message_center::NotifierSettingsObserver* observer) OVERRIDE; |
(...skipping 11 matching lines...) Expand all Loading... |
72 virtual void SetNotifierEnabled(const message_center::Notifier& notifier, | 72 virtual void SetNotifierEnabled(const message_center::Notifier& notifier, |
73 bool enabled) OVERRIDE; | 73 bool enabled) OVERRIDE; |
74 virtual void OnNotifierSettingsClosing() OVERRIDE; | 74 virtual void OnNotifierSettingsClosing() OVERRIDE; |
75 virtual bool NotifierHasAdvancedSettings( | 75 virtual bool NotifierHasAdvancedSettings( |
76 const message_center::NotifierId& notifier_id) const OVERRIDE; | 76 const message_center::NotifierId& notifier_id) const OVERRIDE; |
77 virtual void OnNotifierAdvancedSettingsRequested( | 77 virtual void OnNotifierAdvancedSettingsRequested( |
78 const message_center::NotifierId& notifier_id, | 78 const message_center::NotifierId& notifier_id, |
79 const std::string* notification_id) OVERRIDE; | 79 const std::string* notification_id) OVERRIDE; |
80 | 80 |
81 #if defined(OS_CHROMEOS) | 81 #if defined(OS_CHROMEOS) |
82 // Overridden from chromeos::UserManager::UserSessionStateObserver. | 82 // Overridden from user_manager::UserManager::UserSessionStateObserver. |
83 virtual void ActiveUserChanged( | 83 virtual void ActiveUserChanged( |
84 const user_manager::User* active_user) OVERRIDE; | 84 const user_manager::User* active_user) OVERRIDE; |
85 #endif | 85 #endif |
86 | 86 |
87 // Overridden from extensions::AppIconLoader::Delegate. | 87 // Overridden from extensions::AppIconLoader::Delegate. |
88 virtual void SetAppImage(const std::string& id, | 88 virtual void SetAppImage(const std::string& id, |
89 const gfx::ImageSkia& image) OVERRIDE; | 89 const gfx::ImageSkia& image) OVERRIDE; |
90 | 90 |
91 private: | 91 private: |
92 // Overridden from content::NotificationObserver. | 92 // Overridden from content::NotificationObserver. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 content::NotificationRegistrar registrar_; | 125 content::NotificationRegistrar registrar_; |
126 | 126 |
127 ProfileInfoCache* profile_info_cache_; | 127 ProfileInfoCache* profile_info_cache_; |
128 | 128 |
129 base::WeakPtrFactory<MessageCenterSettingsController> weak_factory_; | 129 base::WeakPtrFactory<MessageCenterSettingsController> weak_factory_; |
130 | 130 |
131 DISALLOW_COPY_AND_ASSIGN(MessageCenterSettingsController); | 131 DISALLOW_COPY_AND_ASSIGN(MessageCenterSettingsController); |
132 }; | 132 }; |
133 | 133 |
134 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_SETTINGS_CONTROLLER_H_ | 134 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_SETTINGS_CONTROLLER_H_ |
OLD | NEW |