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

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

Issue 2497123002: chromeos: Move device shutdown handling out of chrome into ash (Closed)
Patch Set: Created 4 years, 1 month 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "ash/common/accessibility_types.h" 13 #include "ash/common/accessibility_types.h"
14 #include "ash/common/session/session_state_observer.h" 14 #include "ash/common/session/session_state_observer.h"
15 #include "ash/common/system/chromeos/supervised/custodian_info_tray_observer.h" 15 #include "ash/common/system/chromeos/supervised/custodian_info_tray_observer.h"
16 #include "ash/common/system/tray/ime_info.h" 16 #include "ash/common/system/tray/ime_info.h"
17 #include "ash/common/system/tray/system_tray_delegate.h" 17 #include "ash/common/system/tray/system_tray_delegate.h"
18 #include "base/callback_forward.h" 18 #include "base/callback_forward.h"
19 #include "base/callback_list.h" 19 #include "base/callback_list.h"
20 #include "base/compiler_specific.h" 20 #include "base/compiler_specific.h"
21 #include "base/macros.h" 21 #include "base/macros.h"
22 #include "base/memory/ref_counted.h" 22 #include "base/memory/ref_counted.h"
23 #include "base/memory/weak_ptr.h" 23 #include "base/memory/weak_ptr.h"
24 #include "base/observer_list.h" 24 #include "base/observer_list.h"
25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
26 #include "chrome/browser/chromeos/settings/shutdown_policy_handler.h"
27 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" 27 #include "chrome/browser/supervised_user/supervised_user_service_observer.h"
29 #include "chrome/browser/ui/browser_list_observer.h" 28 #include "chrome/browser/ui/browser_list_observer.h"
30 #include "chromeos/audio/cras_audio_handler.h" 29 #include "chromeos/audio/cras_audio_handler.h"
31 #include "chromeos/dbus/session_manager_client.h" 30 #include "chromeos/dbus/session_manager_client.h"
32 #include "components/policy/core/common/cloud/cloud_policy_store.h" 31 #include "components/policy/core/common/cloud/cloud_policy_store.h"
33 #include "components/prefs/pref_change_registrar.h" 32 #include "components/prefs/pref_change_registrar.h"
34 #include "components/signin/core/account_id/account_id.h" 33 #include "components/signin/core/account_id/account_id.h"
35 #include "components/user_manager/user_manager.h" 34 #include "components/user_manager/user_manager.h"
36 #include "content/public/browser/notification_observer.h" 35 #include "content/public/browser/notification_observer.h"
(...skipping 23 matching lines...) Expand all
60 public content::NotificationObserver, 59 public content::NotificationObserver,
61 public input_method::InputMethodManager::Observer, 60 public input_method::InputMethodManager::Observer,
62 public chromeos::CrasAudioHandler::AudioObserver, 61 public chromeos::CrasAudioHandler::AudioObserver,
63 public device::BluetoothAdapter::Observer, 62 public device::BluetoothAdapter::Observer,
64 public policy::CloudPolicyStore::Observer, 63 public policy::CloudPolicyStore::Observer,
65 public ash::SessionStateObserver, 64 public ash::SessionStateObserver,
66 public chrome::BrowserListObserver, 65 public chrome::BrowserListObserver,
67 public extensions::AppWindowRegistry::Observer, 66 public extensions::AppWindowRegistry::Observer,
68 public user_manager::UserManager::UserSessionStateObserver, 67 public user_manager::UserManager::UserSessionStateObserver,
69 public SupervisedUserServiceObserver, 68 public SupervisedUserServiceObserver,
70 public ShutdownPolicyHandler::Delegate,
71 public input_method::InputMethodManager::ImeMenuObserver { 69 public input_method::InputMethodManager::ImeMenuObserver {
72 public: 70 public:
73 SystemTrayDelegateChromeOS(); 71 SystemTrayDelegateChromeOS();
74 72
75 ~SystemTrayDelegateChromeOS() override; 73 ~SystemTrayDelegateChromeOS() override;
76 74
77 void InitializeOnAdapterReady( 75 void InitializeOnAdapterReady(
78 scoped_refptr<device::BluetoothAdapter> adapter); 76 scoped_refptr<device::BluetoothAdapter> adapter);
79 77
80 // Overridden from ash::SystemTrayDelegate: 78 // Overridden from ash::SystemTrayDelegate:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 ash::NetworkingConfigDelegate* GetNetworkingConfigDelegate() const override; 111 ash::NetworkingConfigDelegate* GetNetworkingConfigDelegate() const override;
114 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; 112 bool GetSessionStartTime(base::TimeTicks* session_start_time) override;
115 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; 113 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override;
116 int GetSystemTrayMenuWidth() override; 114 int GetSystemTrayMenuWidth() override;
117 void ActiveUserWasChanged() override; 115 void ActiveUserWasChanged() override;
118 bool IsSearchKeyMappedToCapsLock() override; 116 bool IsSearchKeyMappedToCapsLock() override;
119 void AddCustodianInfoTrayObserver( 117 void AddCustodianInfoTrayObserver(
120 ash::CustodianInfoTrayObserver* observer) override; 118 ash::CustodianInfoTrayObserver* observer) override;
121 void RemoveCustodianInfoTrayObserver( 119 void RemoveCustodianInfoTrayObserver(
122 ash::CustodianInfoTrayObserver* observer) override; 120 ash::CustodianInfoTrayObserver* observer) override;
123 void AddShutdownPolicyObserver(
124 ash::ShutdownPolicyObserver* observer) override;
125 void RemoveShutdownPolicyObserver(
126 ash::ShutdownPolicyObserver* observer) override;
127 void ShouldRebootOnShutdown(
128 const ash::RebootOnShutdownCallback& callback) override;
129 ash::VPNDelegate* GetVPNDelegate() const override; 121 ash::VPNDelegate* GetVPNDelegate() const override;
130 std::unique_ptr<ash::SystemTrayItem> CreateRotationLockTrayItem( 122 std::unique_ptr<ash::SystemTrayItem> CreateRotationLockTrayItem(
131 ash::SystemTray* tray) override; 123 ash::SystemTray* tray) override;
132 124
133 // Overridden from user_manager::UserManager::UserSessionStateObserver: 125 // Overridden from user_manager::UserManager::UserSessionStateObserver:
134 void UserAddedToSession(const user_manager::User* active_user) override; 126 void UserAddedToSession(const user_manager::User* active_user) override;
135 void ActiveUserChanged(const user_manager::User* active_user) override; 127 void ActiveUserChanged(const user_manager::User* active_user) override;
136 128
137 void UserChangedChildStatus(user_manager::User* user) override; 129 void UserChangedChildStatus(user_manager::User* user) override;
138 130
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 217
226 // Overridden from extensions::AppWindowRegistry::Observer: 218 // Overridden from extensions::AppWindowRegistry::Observer:
227 void OnAppWindowRemoved(extensions::AppWindow* app_window) override; 219 void OnAppWindowRemoved(extensions::AppWindow* app_window) override;
228 220
229 // Overridden from SupervisedUserServiceObserver: 221 // Overridden from SupervisedUserServiceObserver:
230 void OnCustodianInfoChanged() override; 222 void OnCustodianInfoChanged() override;
231 223
232 void OnAccessibilityStatusChanged( 224 void OnAccessibilityStatusChanged(
233 const AccessibilityStatusEventDetails& details); 225 const AccessibilityStatusEventDetails& details);
234 226
235 // Overridden from ShutdownPolicyObserver::Delegate.
236 void OnShutdownPolicyChanged(bool reboot_on_shutdown) override;
237
238 // input_method::InputMethodManager::ImeMenuObserver: 227 // input_method::InputMethodManager::ImeMenuObserver:
239 void ImeMenuActivationChanged(bool is_active) override; 228 void ImeMenuActivationChanged(bool is_active) override;
240 void ImeMenuListChanged() override; 229 void ImeMenuListChanged() override;
241 void ImeMenuItemsChanged( 230 void ImeMenuItemsChanged(
242 const std::string& engine_id, 231 const std::string& engine_id,
243 const std::vector<input_method::InputMethodManager::MenuItem>& items) 232 const std::vector<input_method::InputMethodManager::MenuItem>& items)
244 override; 233 override;
245 234
246 // helper methods used by GetSupervisedUserMessage. 235 // helper methods used by GetSupervisedUserMessage.
247 const base::string16 GetLegacySupervisedUserMessage() const; 236 const base::string16 GetLegacySupervisedUserMessage() const;
(...skipping 12 matching lines...) Expand all
260 std::string enterprise_realm_; 249 std::string enterprise_realm_;
261 bool should_run_bluetooth_discovery_ = false; 250 bool should_run_bluetooth_discovery_ = false;
262 bool session_started_ = false; 251 bool session_started_ = false;
263 252
264 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_; 253 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_;
265 std::unique_ptr<device::BluetoothDiscoverySession> 254 std::unique_ptr<device::BluetoothDiscoverySession>
266 bluetooth_discovery_session_; 255 bluetooth_discovery_session_;
267 std::unique_ptr<ash::CastConfigDelegate> cast_config_delegate_; 256 std::unique_ptr<ash::CastConfigDelegate> cast_config_delegate_;
268 std::unique_ptr<ash::NetworkingConfigDelegate> networking_config_delegate_; 257 std::unique_ptr<ash::NetworkingConfigDelegate> networking_config_delegate_;
269 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_; 258 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_;
270 std::unique_ptr<ShutdownPolicyHandler> shutdown_policy_handler_;
271 std::unique_ptr<ash::VPNDelegate> vpn_delegate_; 259 std::unique_ptr<ash::VPNDelegate> vpn_delegate_;
272 260
273 base::ObserverList<ash::CustodianInfoTrayObserver> 261 base::ObserverList<ash::CustodianInfoTrayObserver>
274 custodian_info_changed_observers_; 262 custodian_info_changed_observers_;
275 263
276 base::ObserverList<ash::ShutdownPolicyObserver> shutdown_policy_observers_;
277
278 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_; 264 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_;
279 265
280 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); 266 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS);
281 }; 267 };
282 268
283 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); 269 ash::SystemTrayDelegate* CreateSystemTrayDelegate();
284 270
285 } // namespace chromeos 271 } // namespace chromeos
286 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ 272 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698