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

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: rebase 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/dbus/session_manager_client.h" 29 #include "chromeos/dbus/session_manager_client.h"
31 #include "components/policy/core/common/cloud/cloud_policy_store.h" 30 #include "components/policy/core/common/cloud/cloud_policy_store.h"
32 #include "components/prefs/pref_change_registrar.h" 31 #include "components/prefs/pref_change_registrar.h"
33 #include "components/signin/core/account_id/account_id.h" 32 #include "components/signin/core/account_id/account_id.h"
34 #include "components/user_manager/user_manager.h" 33 #include "components/user_manager/user_manager.h"
35 #include "content/public/browser/notification_observer.h" 34 #include "content/public/browser/notification_observer.h"
36 #include "content/public/browser/notification_registrar.h" 35 #include "content/public/browser/notification_registrar.h"
(...skipping 21 matching lines...) Expand all
58 public SessionManagerClient::Observer, 57 public SessionManagerClient::Observer,
59 public content::NotificationObserver, 58 public content::NotificationObserver,
60 public input_method::InputMethodManager::Observer, 59 public input_method::InputMethodManager::Observer,
61 public device::BluetoothAdapter::Observer, 60 public device::BluetoothAdapter::Observer,
62 public policy::CloudPolicyStore::Observer, 61 public policy::CloudPolicyStore::Observer,
63 public ash::SessionStateObserver, 62 public ash::SessionStateObserver,
64 public chrome::BrowserListObserver, 63 public chrome::BrowserListObserver,
65 public extensions::AppWindowRegistry::Observer, 64 public extensions::AppWindowRegistry::Observer,
66 public user_manager::UserManager::UserSessionStateObserver, 65 public user_manager::UserManager::UserSessionStateObserver,
67 public SupervisedUserServiceObserver, 66 public SupervisedUserServiceObserver,
68 public ShutdownPolicyHandler::Delegate,
69 public input_method::InputMethodManager::ImeMenuObserver { 67 public input_method::InputMethodManager::ImeMenuObserver {
70 public: 68 public:
71 SystemTrayDelegateChromeOS(); 69 SystemTrayDelegateChromeOS();
72 70
73 ~SystemTrayDelegateChromeOS() override; 71 ~SystemTrayDelegateChromeOS() override;
74 72
75 void InitializeOnAdapterReady( 73 void InitializeOnAdapterReady(
76 scoped_refptr<device::BluetoothAdapter> adapter); 74 scoped_refptr<device::BluetoothAdapter> adapter);
77 75
78 // Overridden from ash::SystemTrayDelegate: 76 // Overridden from ash::SystemTrayDelegate:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 ash::NetworkingConfigDelegate* GetNetworkingConfigDelegate() const override; 109 ash::NetworkingConfigDelegate* GetNetworkingConfigDelegate() const override;
112 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; 110 bool GetSessionStartTime(base::TimeTicks* session_start_time) override;
113 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; 111 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override;
114 int GetSystemTrayMenuWidth() override; 112 int GetSystemTrayMenuWidth() override;
115 void ActiveUserWasChanged() override; 113 void ActiveUserWasChanged() override;
116 bool IsSearchKeyMappedToCapsLock() override; 114 bool IsSearchKeyMappedToCapsLock() override;
117 void AddCustodianInfoTrayObserver( 115 void AddCustodianInfoTrayObserver(
118 ash::CustodianInfoTrayObserver* observer) override; 116 ash::CustodianInfoTrayObserver* observer) override;
119 void RemoveCustodianInfoTrayObserver( 117 void RemoveCustodianInfoTrayObserver(
120 ash::CustodianInfoTrayObserver* observer) override; 118 ash::CustodianInfoTrayObserver* observer) override;
121 void AddShutdownPolicyObserver(
122 ash::ShutdownPolicyObserver* observer) override;
123 void RemoveShutdownPolicyObserver(
124 ash::ShutdownPolicyObserver* observer) override;
125 void ShouldRebootOnShutdown(
126 const ash::RebootOnShutdownCallback& callback) override;
127 ash::VPNDelegate* GetVPNDelegate() const override; 119 ash::VPNDelegate* GetVPNDelegate() const override;
128 std::unique_ptr<ash::SystemTrayItem> CreateRotationLockTrayItem( 120 std::unique_ptr<ash::SystemTrayItem> CreateRotationLockTrayItem(
129 ash::SystemTray* tray) override; 121 ash::SystemTray* tray) override;
130 122
131 // Overridden from user_manager::UserManager::UserSessionStateObserver: 123 // Overridden from user_manager::UserManager::UserSessionStateObserver:
132 void UserAddedToSession(const user_manager::User* active_user) override; 124 void UserAddedToSession(const user_manager::User* active_user) override;
133 void ActiveUserChanged(const user_manager::User* active_user) override; 125 void ActiveUserChanged(const user_manager::User* active_user) override;
134 126
135 void UserChangedChildStatus(user_manager::User* user) override; 127 void UserChangedChildStatus(user_manager::User* user) override;
136 128
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 206
215 // Overridden from extensions::AppWindowRegistry::Observer: 207 // Overridden from extensions::AppWindowRegistry::Observer:
216 void OnAppWindowRemoved(extensions::AppWindow* app_window) override; 208 void OnAppWindowRemoved(extensions::AppWindow* app_window) override;
217 209
218 // Overridden from SupervisedUserServiceObserver: 210 // Overridden from SupervisedUserServiceObserver:
219 void OnCustodianInfoChanged() override; 211 void OnCustodianInfoChanged() override;
220 212
221 void OnAccessibilityStatusChanged( 213 void OnAccessibilityStatusChanged(
222 const AccessibilityStatusEventDetails& details); 214 const AccessibilityStatusEventDetails& details);
223 215
224 // Overridden from ShutdownPolicyObserver::Delegate.
225 void OnShutdownPolicyChanged(bool reboot_on_shutdown) override;
226
227 // input_method::InputMethodManager::ImeMenuObserver: 216 // input_method::InputMethodManager::ImeMenuObserver:
228 void ImeMenuActivationChanged(bool is_active) override; 217 void ImeMenuActivationChanged(bool is_active) override;
229 void ImeMenuListChanged() override; 218 void ImeMenuListChanged() override;
230 void ImeMenuItemsChanged( 219 void ImeMenuItemsChanged(
231 const std::string& engine_id, 220 const std::string& engine_id,
232 const std::vector<input_method::InputMethodManager::MenuItem>& items) 221 const std::vector<input_method::InputMethodManager::MenuItem>& items)
233 override; 222 override;
234 223
235 // helper methods used by GetSupervisedUserMessage. 224 // helper methods used by GetSupervisedUserMessage.
236 const base::string16 GetLegacySupervisedUserMessage() const; 225 const base::string16 GetLegacySupervisedUserMessage() const;
(...skipping 12 matching lines...) Expand all
249 std::string enterprise_realm_; 238 std::string enterprise_realm_;
250 bool should_run_bluetooth_discovery_ = false; 239 bool should_run_bluetooth_discovery_ = false;
251 bool session_started_ = false; 240 bool session_started_ = false;
252 241
253 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_; 242 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_;
254 std::unique_ptr<device::BluetoothDiscoverySession> 243 std::unique_ptr<device::BluetoothDiscoverySession>
255 bluetooth_discovery_session_; 244 bluetooth_discovery_session_;
256 std::unique_ptr<ash::CastConfigDelegate> cast_config_delegate_; 245 std::unique_ptr<ash::CastConfigDelegate> cast_config_delegate_;
257 std::unique_ptr<ash::NetworkingConfigDelegate> networking_config_delegate_; 246 std::unique_ptr<ash::NetworkingConfigDelegate> networking_config_delegate_;
258 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_; 247 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_;
259 std::unique_ptr<ShutdownPolicyHandler> shutdown_policy_handler_;
260 std::unique_ptr<ash::VPNDelegate> vpn_delegate_; 248 std::unique_ptr<ash::VPNDelegate> vpn_delegate_;
261 249
262 base::ObserverList<ash::CustodianInfoTrayObserver> 250 base::ObserverList<ash::CustodianInfoTrayObserver>
263 custodian_info_changed_observers_; 251 custodian_info_changed_observers_;
264 252
265 base::ObserverList<ash::ShutdownPolicyObserver> shutdown_policy_observers_;
266
267 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_; 253 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_;
268 254
269 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); 255 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS);
270 }; 256 };
271 257
272 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); 258 ash::SystemTrayDelegate* CreateSystemTrayDelegate();
273 259
274 } // namespace chromeos 260 } // namespace chromeos
275 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ 261 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/shutdown_policy_browsertest.cc ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698