OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COMMON_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_ |
6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_ | 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/i18n/time_formatting.h" | 12 #include "base/i18n/time_formatting.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 class SystemTrayNotifier; | 19 class SystemTrayNotifier; |
20 } | 20 } |
21 | 21 |
22 // Common base class for platform-specific implementations. | 22 // Common base class for platform-specific implementations. |
23 class SystemTrayDelegateCommon : public ash::SystemTrayDelegate, | 23 class SystemTrayDelegateCommon : public ash::SystemTrayDelegate, |
24 public content::NotificationObserver { | 24 public content::NotificationObserver { |
25 public: | 25 public: |
26 SystemTrayDelegateCommon(); | 26 SystemTrayDelegateCommon(); |
27 | 27 |
28 virtual ~SystemTrayDelegateCommon(); | 28 ~SystemTrayDelegateCommon() override; |
29 | 29 |
30 // Overridden from ash::SystemTrayDelegate: | 30 // Overridden from ash::SystemTrayDelegate: |
31 virtual void Initialize() override; | 31 void Initialize() override; |
32 virtual void Shutdown() override; | 32 void Shutdown() override; |
33 virtual bool GetTrayVisibilityOnStartup() override; | 33 bool GetTrayVisibilityOnStartup() override; |
34 virtual ash::user::LoginStatus GetUserLoginStatus() const override; | 34 ash::user::LoginStatus GetUserLoginStatus() const override; |
35 virtual void ChangeProfilePicture() override; | 35 void ChangeProfilePicture() override; |
36 virtual const std::string GetEnterpriseDomain() const override; | 36 const std::string GetEnterpriseDomain() const override; |
37 virtual const base::string16 GetEnterpriseMessage() const override; | 37 const base::string16 GetEnterpriseMessage() const override; |
38 virtual const std::string GetSupervisedUserManager() const override; | 38 const std::string GetSupervisedUserManager() const override; |
39 virtual const base::string16 GetSupervisedUserManagerName() const override; | 39 const base::string16 GetSupervisedUserManagerName() const override; |
40 virtual const base::string16 GetSupervisedUserMessage() const override; | 40 const base::string16 GetSupervisedUserMessage() const override; |
41 virtual bool IsUserSupervised() const override; | 41 bool IsUserSupervised() const override; |
42 virtual void GetSystemUpdateInfo(ash::UpdateInfo* info) const override; | 42 void GetSystemUpdateInfo(ash::UpdateInfo* info) const override; |
43 virtual base::HourClockType GetHourClockType() const override; | 43 base::HourClockType GetHourClockType() const override; |
44 virtual void ShowSettings() override; | 44 void ShowSettings() override; |
45 virtual bool ShouldShowSettings() override; | 45 bool ShouldShowSettings() override; |
46 virtual void ShowDateSettings() override; | 46 void ShowDateSettings() override; |
47 virtual void ShowSetTimeDialog() override; | 47 void ShowSetTimeDialog() override; |
48 virtual void ShowNetworkSettings(const std::string& service_path) override; | 48 void ShowNetworkSettings(const std::string& service_path) override; |
49 virtual void ShowBluetoothSettings() override; | 49 void ShowBluetoothSettings() override; |
50 virtual void ShowDisplaySettings() override; | 50 void ShowDisplaySettings() override; |
51 virtual void ShowChromeSlow() override; | 51 void ShowChromeSlow() override; |
52 virtual bool ShouldShowDisplayNotification() override; | 52 bool ShouldShowDisplayNotification() override; |
53 virtual void ShowIMESettings() override; | 53 void ShowIMESettings() override; |
54 virtual void ShowHelp() override; | 54 void ShowHelp() override; |
55 virtual void ShowAccessibilityHelp() override; | 55 void ShowAccessibilityHelp() override; |
56 virtual void ShowAccessibilitySettings() override; | 56 void ShowAccessibilitySettings() override; |
57 virtual void ShowPublicAccountInfo() override; | 57 void ShowPublicAccountInfo() override; |
58 virtual void ShowSupervisedUserInfo() override; | 58 void ShowSupervisedUserInfo() override; |
59 virtual void ShowEnterpriseInfo() override; | 59 void ShowEnterpriseInfo() override; |
60 virtual void ShowUserLogin() override; | 60 void ShowUserLogin() override; |
61 virtual bool ShowSpringChargerReplacementDialog() override; | 61 bool ShowSpringChargerReplacementDialog() override; |
62 virtual bool IsSpringChargerReplacementDialogVisible() override; | 62 bool IsSpringChargerReplacementDialogVisible() override; |
63 virtual bool HasUserConfirmedSafeSpringCharger() override; | 63 bool HasUserConfirmedSafeSpringCharger() override; |
64 virtual void ShutDown() override; | 64 void ShutDown() override; |
65 virtual void SignOut() override; | 65 void SignOut() override; |
66 virtual void RequestLockScreen() override; | 66 void RequestLockScreen() override; |
67 virtual void RequestRestartForUpdate() override; | 67 void RequestRestartForUpdate() override; |
68 virtual void GetAvailableBluetoothDevices( | 68 void GetAvailableBluetoothDevices(ash::BluetoothDeviceList* list) override; |
69 ash::BluetoothDeviceList* list) override; | 69 void BluetoothStartDiscovering() override; |
70 virtual void BluetoothStartDiscovering() override; | 70 void BluetoothStopDiscovering() override; |
71 virtual void BluetoothStopDiscovering() override; | 71 void ConnectToBluetoothDevice(const std::string& address) override; |
72 virtual void ConnectToBluetoothDevice(const std::string& address) override; | 72 bool IsBluetoothDiscovering() override; |
73 virtual bool IsBluetoothDiscovering() override; | 73 void GetCurrentIME(ash::IMEInfo* info) override; |
74 virtual void GetCurrentIME(ash::IMEInfo* info) override; | 74 void GetAvailableIMEList(ash::IMEInfoList* list) override; |
75 virtual void GetAvailableIMEList(ash::IMEInfoList* list) override; | 75 void GetCurrentIMEProperties(ash::IMEPropertyInfoList* list) override; |
76 virtual void GetCurrentIMEProperties(ash::IMEPropertyInfoList* list) override; | 76 void SwitchIME(const std::string& ime_id) override; |
77 virtual void SwitchIME(const std::string& ime_id) override; | 77 void ActivateIMEProperty(const std::string& key) override; |
78 virtual void ActivateIMEProperty(const std::string& key) override; | 78 void ManageBluetoothDevices() override; |
79 virtual void ShowNetworkConfigure(const std::string& network_id) override; | 79 void ToggleBluetooth() override; |
80 virtual bool EnrollNetwork(const std::string& network_id) override; | 80 void ShowOtherNetworkDialog(const std::string& type) override; |
81 virtual void ManageBluetoothDevices() override; | 81 bool GetBluetoothAvailable() override; |
82 virtual void ToggleBluetooth() override; | 82 bool GetBluetoothEnabled() override; |
83 virtual void ShowMobileSimDialog() override; | 83 bool GetBluetoothDiscovering() override; |
84 virtual void ShowMobileSetupDialog(const std::string& service_path) override; | 84 void ChangeProxySettings() override; |
85 virtual void ShowOtherNetworkDialog(const std::string& type) override; | 85 ash::VolumeControlDelegate* GetVolumeControlDelegate() const override; |
86 virtual bool GetBluetoothAvailable() override; | 86 void SetVolumeControlDelegate( |
87 virtual bool GetBluetoothEnabled() override; | |
88 virtual bool GetBluetoothDiscovering() override; | |
89 virtual void ChangeProxySettings() override; | |
90 virtual ash::VolumeControlDelegate* GetVolumeControlDelegate() const override; | |
91 virtual void SetVolumeControlDelegate( | |
92 scoped_ptr<ash::VolumeControlDelegate> delegate) override; | 87 scoped_ptr<ash::VolumeControlDelegate> delegate) override; |
93 virtual bool GetSessionStartTime( | 88 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; |
94 base::TimeTicks* session_start_time) override; | 89 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; |
95 virtual bool GetSessionLengthLimit( | 90 int GetSystemTrayMenuWidth() override; |
96 base::TimeDelta* session_length_limit) override; | 91 void ActiveUserWasChanged() override; |
97 virtual int GetSystemTrayMenuWidth() override; | 92 bool IsSearchKeyMappedToCapsLock() override; |
98 virtual void ActiveUserWasChanged() override; | 93 ash::tray::UserAccountsDelegate* GetUserAccountsDelegate( |
99 virtual bool IsSearchKeyMappedToCapsLock() override; | |
100 virtual ash::tray::UserAccountsDelegate* GetUserAccountsDelegate( | |
101 const std::string& user_id) override; | 94 const std::string& user_id) override; |
102 virtual void AddCustodianInfoTrayObserver( | 95 void AddCustodianInfoTrayObserver( |
103 ash::CustodianInfoTrayObserver* observer) override; | 96 ash::CustodianInfoTrayObserver* observer) override; |
104 virtual void RemoveCustodianInfoTrayObserver( | 97 void RemoveCustodianInfoTrayObserver( |
105 ash::CustodianInfoTrayObserver* observer) override; | 98 ash::CustodianInfoTrayObserver* observer) override; |
106 | 99 |
107 private: | 100 private: |
108 ash::SystemTrayNotifier* GetSystemTrayNotifier(); | 101 ash::SystemTrayNotifier* GetSystemTrayNotifier(); |
109 | 102 |
110 void UpdateClockType(); | 103 void UpdateClockType(); |
111 | 104 |
112 // content::NotificationObserver implementation. | 105 // content::NotificationObserver implementation. |
113 virtual void Observe(int type, | 106 void Observe(int type, |
114 const content::NotificationSource& source, | 107 const content::NotificationSource& source, |
115 const content::NotificationDetails& details) override; | 108 const content::NotificationDetails& details) override; |
116 | 109 |
117 scoped_ptr<content::NotificationRegistrar> registrar_; | 110 scoped_ptr<content::NotificationRegistrar> registrar_; |
118 base::HourClockType clock_type_; | 111 base::HourClockType clock_type_; |
119 | 112 |
120 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateCommon); | 113 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateCommon); |
121 }; | 114 }; |
122 | 115 |
123 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_ | 116 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_COMMON_H_ |
OLD | NEW |