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

Side by Side Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.h

Issue 627593003: Adding infrastructure for possibility of changing manager names for the supervised accounts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Daniel's comments addressed. Created 6 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_
6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_
7 7
8 #include <vector>
9
8 #include "ash/ime/input_method_menu_manager.h" 10 #include "ash/ime/input_method_menu_manager.h"
9 #include "ash/session/session_state_observer.h" 11 #include "ash/session/session_state_observer.h"
12 #include "ash/system/chromeos/supervised/custodian_info_tray_observer.h"
10 #include "ash/system/tray/system_tray.h" 13 #include "ash/system/tray/system_tray.h"
11 #include "ash/system/tray/system_tray_delegate.h" 14 #include "ash/system/tray/system_tray_delegate.h"
12 #include "ash/system/tray/system_tray_notifier.h" 15 #include "ash/system/tray/system_tray_notifier.h"
16 #include "base/callback_forward.h"
13 #include "base/callback_list.h" 17 #include "base/callback_list.h"
14 #include "base/compiler_specific.h" 18 #include "base/compiler_specific.h"
15 #include "base/containers/scoped_ptr_hash_map.h" 19 #include "base/containers/scoped_ptr_hash_map.h"
16 #include "base/memory/ref_counted.h" 20 #include "base/memory/ref_counted.h"
17 #include "base/memory/weak_ptr.h" 21 #include "base/memory/weak_ptr.h"
22 #include "base/observer_list.h"
18 #include "base/prefs/pref_change_registrar.h" 23 #include "base/prefs/pref_change_registrar.h"
19 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 24 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
20 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" 26 #include "chrome/browser/supervised_user/supervised_user_service_observer.h"
22 #include "chrome/browser/ui/browser_list_observer.h" 27 #include "chrome/browser/ui/browser_list_observer.h"
23 #include "chromeos/audio/cras_audio_handler.h" 28 #include "chromeos/audio/cras_audio_handler.h"
24 #include "chromeos/dbus/session_manager_client.h" 29 #include "chromeos/dbus/session_manager_client.h"
25 #include "chromeos/ime/input_method_manager.h" 30 #include "chromeos/ime/input_method_manager.h"
26 #include "chromeos/login/login_state.h" 31 #include "chromeos/login/login_state.h"
27 #include "components/policy/core/common/cloud/cloud_policy_store.h" 32 #include "components/policy/core/common/cloud/cloud_policy_store.h"
28 #include "content/public/browser/notification_observer.h" 33 #include "content/public/browser/notification_observer.h"
29 #include "content/public/browser/notification_registrar.h" 34 #include "content/public/browser/notification_registrar.h"
30 #include "device/bluetooth/bluetooth_adapter.h" 35 #include "device/bluetooth/bluetooth_adapter.h"
31 #include "device/bluetooth/bluetooth_discovery_session.h" 36 #include "device/bluetooth/bluetooth_discovery_session.h"
32 #include "extensions/browser/app_window/app_window_registry.h" 37 #include "extensions/browser/app_window/app_window_registry.h"
33 38
34 namespace chromeos { 39 namespace chromeos {
35 40
36 class SystemTrayDelegateChromeOS 41 class SystemTrayDelegateChromeOS
37 : public ash::ime::InputMethodMenuManager::Observer, 42 : public ash::ime::InputMethodMenuManager::Observer,
38 public ash::SystemTrayDelegate, 43 public ash::SystemTrayDelegate,
39 public SessionManagerClient::Observer, 44 public SessionManagerClient::Observer,
40 public content::NotificationObserver, 45 public content::NotificationObserver,
41 public input_method::InputMethodManager::Observer, 46 public input_method::InputMethodManager::Observer,
42 public chromeos::LoginState::Observer, 47 public chromeos::LoginState::Observer,
43 public chromeos::CrasAudioHandler::AudioObserver, 48 public chromeos::CrasAudioHandler::AudioObserver,
44 public device::BluetoothAdapter::Observer, 49 public device::BluetoothAdapter::Observer,
45 public policy::CloudPolicyStore::Observer, 50 public policy::CloudPolicyStore::Observer,
46 public ash::SessionStateObserver, 51 public ash::SessionStateObserver,
47 public chrome::BrowserListObserver, 52 public chrome::BrowserListObserver,
48 public extensions::AppWindowRegistry::Observer { 53 public extensions::AppWindowRegistry::Observer,
54 public SupervisedUserServiceObserver {
49 public: 55 public:
50 SystemTrayDelegateChromeOS(); 56 SystemTrayDelegateChromeOS();
51 57
52 virtual ~SystemTrayDelegateChromeOS(); 58 virtual ~SystemTrayDelegateChromeOS();
53 59
54 void InitializeOnAdapterReady( 60 void InitializeOnAdapterReady(
55 scoped_refptr<device::BluetoothAdapter> adapter); 61 scoped_refptr<device::BluetoothAdapter> adapter);
56 62
57 // Overridden from ash::SystemTrayDelegate: 63 // Overridden from ash::SystemTrayDelegate:
58 virtual void Initialize() override; 64 virtual void Initialize() override;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 scoped_ptr<ash::VolumeControlDelegate> delegate) override; 125 scoped_ptr<ash::VolumeControlDelegate> delegate) override;
120 virtual bool GetSessionStartTime(base::TimeTicks* session_start_time) 126 virtual bool GetSessionStartTime(base::TimeTicks* session_start_time)
121 override; 127 override;
122 virtual bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) 128 virtual bool GetSessionLengthLimit(base::TimeDelta* session_length_limit)
123 override; 129 override;
124 virtual int GetSystemTrayMenuWidth() override; 130 virtual int GetSystemTrayMenuWidth() override;
125 virtual void ActiveUserWasChanged() override; 131 virtual void ActiveUserWasChanged() override;
126 virtual bool IsSearchKeyMappedToCapsLock() override; 132 virtual bool IsSearchKeyMappedToCapsLock() override;
127 virtual ash::tray::UserAccountsDelegate* GetUserAccountsDelegate( 133 virtual ash::tray::UserAccountsDelegate* GetUserAccountsDelegate(
128 const std::string& user_id) override; 134 const std::string& user_id) override;
135 virtual void AddCustodianInfoTrayObserver(
136 ash::CustodianInfoTrayObserver* observer) override;
137 virtual void RemoveCustodianInfoTrayObserver(
138 ash::CustodianInfoTrayObserver* observer) override;
129 139
130 // browser tests need to call ShouldUse24HourClock(). 140 // browser tests need to call ShouldUse24HourClock().
131 bool GetShouldUse24HourClockForTesting() const; 141 bool GetShouldUse24HourClockForTesting() const;
132 142
133 private: 143 private:
134 // Should be the same as CrosSettings::ObserverSubscription. 144 // Should be the same as CrosSettings::ObserverSubscription.
135 typedef base::CallbackList<void(void)>::Subscription 145 typedef base::CallbackList<void(void)>::Subscription
136 CrosSettingsObserverSubscription; 146 CrosSettingsObserverSubscription;
137 147
138 ash::SystemTray* GetPrimarySystemTray(); 148 ash::SystemTray* GetPrimarySystemTray();
(...skipping 11 matching lines...) Expand all
150 void UpdateShowLogoutButtonInTray(); 160 void UpdateShowLogoutButtonInTray();
151 161
152 void UpdateLogoutDialogDuration(); 162 void UpdateLogoutDialogDuration();
153 163
154 void UpdateSessionStartTime(); 164 void UpdateSessionStartTime();
155 165
156 void UpdateSessionLengthLimit(); 166 void UpdateSessionLengthLimit();
157 167
158 void StopObservingAppWindowRegistry(); 168 void StopObservingAppWindowRegistry();
159 169
170 void StopObservingCustodianInfoChanges();
171
160 // Notify observers if the current user has no more open browser or app 172 // Notify observers if the current user has no more open browser or app
161 // windows. 173 // windows.
162 void NotifyIfLastWindowClosed(); 174 void NotifyIfLastWindowClosed();
163 175
164 // LoginState::Observer overrides. 176 // LoginState::Observer overrides.
165 virtual void LoggedInStateChanged() override; 177 virtual void LoggedInStateChanged() override;
166 178
167 // Overridden from SessionManagerClient::Observer. 179 // Overridden from SessionManagerClient::Observer.
168 virtual void ScreenIsLocked() override; 180 virtual void ScreenIsLocked() override;
169 virtual void ScreenIsUnlocked() override; 181 virtual void ScreenIsUnlocked() override;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 236
225 // Overridden from ash::SessionStateObserver 237 // Overridden from ash::SessionStateObserver
226 virtual void UserAddedToSession(const std::string& user_id) override; 238 virtual void UserAddedToSession(const std::string& user_id) override;
227 239
228 // Overridden from chrome::BrowserListObserver: 240 // Overridden from chrome::BrowserListObserver:
229 virtual void OnBrowserRemoved(Browser* browser) override; 241 virtual void OnBrowserRemoved(Browser* browser) override;
230 242
231 // Overridden from extensions::AppWindowRegistry::Observer: 243 // Overridden from extensions::AppWindowRegistry::Observer:
232 virtual void OnAppWindowRemoved(extensions::AppWindow* app_window) override; 244 virtual void OnAppWindowRemoved(extensions::AppWindow* app_window) override;
233 245
246 // Overridden from SupervisedUserServiceObserver:
247 virtual void OnCustodianInfoChanged() OVERRIDE;
Daniel Erat 2014/10/08 14:10:46 s/OVERRIDE/override/ to match the rest of this fil
248
234 void OnAccessibilityStatusChanged( 249 void OnAccessibilityStatusChanged(
235 const AccessibilityStatusEventDetails& details); 250 const AccessibilityStatusEventDetails& details);
236 251
237 scoped_ptr<content::NotificationRegistrar> registrar_; 252 scoped_ptr<content::NotificationRegistrar> registrar_;
238 scoped_ptr<PrefChangeRegistrar> local_state_registrar_; 253 scoped_ptr<PrefChangeRegistrar> local_state_registrar_;
239 scoped_ptr<PrefChangeRegistrar> user_pref_registrar_; 254 scoped_ptr<PrefChangeRegistrar> user_pref_registrar_;
240 Profile* user_profile_; 255 Profile* user_profile_;
241 base::HourClockType clock_type_; 256 base::HourClockType clock_type_;
242 int search_key_mapped_to_; 257 int search_key_mapped_to_;
243 bool screen_locked_; 258 bool screen_locked_;
244 bool have_session_start_time_; 259 bool have_session_start_time_;
245 base::TimeTicks session_start_time_; 260 base::TimeTicks session_start_time_;
246 bool have_session_length_limit_; 261 bool have_session_length_limit_;
247 base::TimeDelta session_length_limit_; 262 base::TimeDelta session_length_limit_;
248 std::string enterprise_domain_; 263 std::string enterprise_domain_;
249 bool should_run_bluetooth_discovery_; 264 bool should_run_bluetooth_discovery_;
250 265
251 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_; 266 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_;
252 scoped_ptr<device::BluetoothDiscoverySession> bluetooth_discovery_session_; 267 scoped_ptr<device::BluetoothDiscoverySession> bluetooth_discovery_session_;
253 scoped_ptr<ash::VolumeControlDelegate> volume_control_delegate_; 268 scoped_ptr<ash::VolumeControlDelegate> volume_control_delegate_;
254 scoped_ptr<CrosSettingsObserverSubscription> device_settings_observer_; 269 scoped_ptr<CrosSettingsObserverSubscription> device_settings_observer_;
255 scoped_ptr<AccessibilityStatusSubscription> accessibility_subscription_; 270 scoped_ptr<AccessibilityStatusSubscription> accessibility_subscription_;
256 base::ScopedPtrHashMap<std::string, ash::tray::UserAccountsDelegate> 271 base::ScopedPtrHashMap<std::string, ash::tray::UserAccountsDelegate>
257 accounts_delegates_; 272 accounts_delegates_;
258 273
274 ObserverList<ash::CustodianInfoTrayObserver>
275 custodian_info_changed_observers_;
276
259 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_; 277 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_;
260 278
261 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); 279 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS);
262 }; 280 };
263 281
264 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); 282 ash::SystemTrayDelegate* CreateSystemTrayDelegate();
265 283
266 } // namespace chromeos 284 } // namespace chromeos
267 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ 285 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698