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

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

Issue 811033002: Add device policy to disallow shutdown - ash UI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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> 8 #include <vector>
9 9
10 #include "ash/session/session_state_observer.h" 10 #include "ash/session/session_state_observer.h"
11 #include "ash/system/chromeos/supervised/custodian_info_tray_observer.h" 11 #include "ash/system/chromeos/supervised/custodian_info_tray_observer.h"
12 #include "ash/system/tray/system_tray.h" 12 #include "ash/system/tray/system_tray.h"
13 #include "ash/system/tray/system_tray_delegate.h" 13 #include "ash/system/tray/system_tray_delegate.h"
14 #include "ash/system/tray/system_tray_notifier.h" 14 #include "ash/system/tray/system_tray_notifier.h"
15 #include "base/callback_forward.h" 15 #include "base/callback_forward.h"
16 #include "base/callback_list.h" 16 #include "base/callback_list.h"
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/containers/scoped_ptr_hash_map.h" 18 #include "base/containers/scoped_ptr_hash_map.h"
19 #include "base/memory/ref_counted.h" 19 #include "base/memory/ref_counted.h"
20 #include "base/memory/weak_ptr.h" 20 #include "base/memory/weak_ptr.h"
21 #include "base/observer_list.h" 21 #include "base/observer_list.h"
22 #include "base/prefs/pref_change_registrar.h" 22 #include "base/prefs/pref_change_registrar.h"
23 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 23 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
24 #include "chrome/browser/chromeos/settings/shutdown_policy_handler.h"
24 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" 26 #include "chrome/browser/supervised_user/supervised_user_service_observer.h"
26 #include "chrome/browser/ui/browser_list_observer.h" 27 #include "chrome/browser/ui/browser_list_observer.h"
27 #include "chromeos/audio/cras_audio_handler.h" 28 #include "chromeos/audio/cras_audio_handler.h"
28 #include "chromeos/dbus/session_manager_client.h" 29 #include "chromeos/dbus/session_manager_client.h"
29 #include "chromeos/login/login_state.h" 30 #include "chromeos/login/login_state.h"
30 #include "components/policy/core/common/cloud/cloud_policy_store.h" 31 #include "components/policy/core/common/cloud/cloud_policy_store.h"
31 #include "components/user_manager/user_manager.h" 32 #include "components/user_manager/user_manager.h"
32 #include "content/public/browser/notification_observer.h" 33 #include "content/public/browser/notification_observer.h"
33 #include "content/public/browser/notification_registrar.h" 34 #include "content/public/browser/notification_registrar.h"
(...skipping 16 matching lines...) Expand all
50 public content::NotificationObserver, 51 public content::NotificationObserver,
51 public input_method::InputMethodManager::Observer, 52 public input_method::InputMethodManager::Observer,
52 public chromeos::LoginState::Observer, 53 public chromeos::LoginState::Observer,
53 public chromeos::CrasAudioHandler::AudioObserver, 54 public chromeos::CrasAudioHandler::AudioObserver,
54 public device::BluetoothAdapter::Observer, 55 public device::BluetoothAdapter::Observer,
55 public policy::CloudPolicyStore::Observer, 56 public policy::CloudPolicyStore::Observer,
56 public ash::SessionStateObserver, 57 public ash::SessionStateObserver,
57 public chrome::BrowserListObserver, 58 public chrome::BrowserListObserver,
58 public extensions::AppWindowRegistry::Observer, 59 public extensions::AppWindowRegistry::Observer,
59 public user_manager::UserManager::UserSessionStateObserver, 60 public user_manager::UserManager::UserSessionStateObserver,
60 public SupervisedUserServiceObserver { 61 public SupervisedUserServiceObserver,
62 public ShutdownPolicyHandler::Delegate {
61 public: 63 public:
62 SystemTrayDelegateChromeOS(); 64 SystemTrayDelegateChromeOS();
63 65
64 ~SystemTrayDelegateChromeOS() override; 66 ~SystemTrayDelegateChromeOS() override;
65 67
66 void InitializeOnAdapterReady( 68 void InitializeOnAdapterReady(
67 scoped_refptr<device::BluetoothAdapter> adapter); 69 scoped_refptr<device::BluetoothAdapter> adapter);
68 70
69 // Overridden from ash::SystemTrayDelegate: 71 // Overridden from ash::SystemTrayDelegate:
70 void Initialize() override; 72 void Initialize() override;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; 127 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override;
126 int GetSystemTrayMenuWidth() override; 128 int GetSystemTrayMenuWidth() override;
127 void ActiveUserWasChanged() override; 129 void ActiveUserWasChanged() override;
128 bool IsSearchKeyMappedToCapsLock() override; 130 bool IsSearchKeyMappedToCapsLock() override;
129 ash::tray::UserAccountsDelegate* GetUserAccountsDelegate( 131 ash::tray::UserAccountsDelegate* GetUserAccountsDelegate(
130 const std::string& user_id) override; 132 const std::string& user_id) override;
131 void AddCustodianInfoTrayObserver( 133 void AddCustodianInfoTrayObserver(
132 ash::CustodianInfoTrayObserver* observer) override; 134 ash::CustodianInfoTrayObserver* observer) override;
133 void RemoveCustodianInfoTrayObserver( 135 void RemoveCustodianInfoTrayObserver(
134 ash::CustodianInfoTrayObserver* observer) override; 136 ash::CustodianInfoTrayObserver* observer) override;
137 void AddShutdownPolicyObserver(
138 ash::ShutdownPolicyObserver* observer) override;
139 void RemoveShutdownPolicyObserver(
140 ash::ShutdownPolicyObserver* observer) override;
141 void ShouldRebootOnShutdown(
142 const ash::RebootOnShutdownCallback& callback) override;
135 143
136 // Overridden from user_manager::UserManager::UserSessionStateObserver: 144 // Overridden from user_manager::UserManager::UserSessionStateObserver:
137 void UserAddedToSession(const user_manager::User* active_user) override; 145 void UserAddedToSession(const user_manager::User* active_user) override;
138 void ActiveUserChanged(const user_manager::User* active_user) override; 146 void ActiveUserChanged(const user_manager::User* active_user) override;
139 147
140 void UserChangedChildStatus(user_manager::User* user) override; 148 void UserChangedChildStatus(user_manager::User* user) override;
141 149
142 // browser tests need to call ShouldUse24HourClock(). 150 // browser tests need to call ShouldUse24HourClock().
143 bool GetShouldUse24HourClockForTesting() const; 151 bool GetShouldUse24HourClockForTesting() const;
144 152
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 253
246 // Overridden from extensions::AppWindowRegistry::Observer: 254 // Overridden from extensions::AppWindowRegistry::Observer:
247 void OnAppWindowRemoved(extensions::AppWindow* app_window) override; 255 void OnAppWindowRemoved(extensions::AppWindow* app_window) override;
248 256
249 // Overridden from SupervisedUserServiceObserver: 257 // Overridden from SupervisedUserServiceObserver:
250 void OnCustodianInfoChanged() override; 258 void OnCustodianInfoChanged() override;
251 259
252 void OnAccessibilityStatusChanged( 260 void OnAccessibilityStatusChanged(
253 const AccessibilityStatusEventDetails& details); 261 const AccessibilityStatusEventDetails& details);
254 262
263 // Overridden from ShutdownPolicyObserver::Delegate.
264 void OnShutdownPolicyChanged(bool reboot_on_shutdown) override;
265
255 // helper methods used by GetSupervisedUserMessage. 266 // helper methods used by GetSupervisedUserMessage.
256 const base::string16 GetLegacySupervisedUserMessage() const; 267 const base::string16 GetLegacySupervisedUserMessage() const;
257 const base::string16 GetChildUserMessage() const; 268 const base::string16 GetChildUserMessage() const;
258 269
259 scoped_ptr<content::NotificationRegistrar> registrar_; 270 scoped_ptr<content::NotificationRegistrar> registrar_;
260 scoped_ptr<PrefChangeRegistrar> local_state_registrar_; 271 scoped_ptr<PrefChangeRegistrar> local_state_registrar_;
261 scoped_ptr<PrefChangeRegistrar> user_pref_registrar_; 272 scoped_ptr<PrefChangeRegistrar> user_pref_registrar_;
262 Profile* user_profile_; 273 Profile* user_profile_;
263 base::HourClockType clock_type_; 274 base::HourClockType clock_type_;
264 int search_key_mapped_to_; 275 int search_key_mapped_to_;
265 bool screen_locked_; 276 bool screen_locked_;
266 bool have_session_start_time_; 277 bool have_session_start_time_;
267 base::TimeTicks session_start_time_; 278 base::TimeTicks session_start_time_;
268 bool have_session_length_limit_; 279 bool have_session_length_limit_;
269 base::TimeDelta session_length_limit_; 280 base::TimeDelta session_length_limit_;
270 std::string enterprise_domain_; 281 std::string enterprise_domain_;
271 bool should_run_bluetooth_discovery_; 282 bool should_run_bluetooth_discovery_;
272 bool session_started_; 283 bool session_started_;
273 284
274 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_; 285 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_;
275 scoped_ptr<device::BluetoothDiscoverySession> bluetooth_discovery_session_; 286 scoped_ptr<device::BluetoothDiscoverySession> bluetooth_discovery_session_;
276 scoped_ptr<ash::VolumeControlDelegate> volume_control_delegate_; 287 scoped_ptr<ash::VolumeControlDelegate> volume_control_delegate_;
277 scoped_ptr<CrosSettingsObserverSubscription> device_settings_observer_; 288 scoped_ptr<CrosSettingsObserverSubscription> device_settings_observer_;
278 scoped_ptr<AccessibilityStatusSubscription> accessibility_subscription_; 289 scoped_ptr<AccessibilityStatusSubscription> accessibility_subscription_;
279 base::ScopedPtrHashMap<std::string, ash::tray::UserAccountsDelegate> 290 base::ScopedPtrHashMap<std::string, ash::tray::UserAccountsDelegate>
280 accounts_delegates_; 291 accounts_delegates_;
292 scoped_ptr<ShutdownPolicyHandler> shutdown_policy_handler_;
281 293
282 ObserverList<ash::CustodianInfoTrayObserver> 294 ObserverList<ash::CustodianInfoTrayObserver>
283 custodian_info_changed_observers_; 295 custodian_info_changed_observers_;
284 296
297 ObserverList<ash::ShutdownPolicyObserver> shutdown_policy_observers_;
298
285 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_; 299 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_;
286 300
287 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); 301 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS);
288 }; 302 };
289 303
290 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); 304 ash::SystemTrayDelegate* CreateSystemTrayDelegate();
291 305
292 } // namespace chromeos 306 } // namespace chromeos
293 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ 307 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698