| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
| 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
| 13 #include "ash/common/login_status.h" | 13 #include "ash/common/login_status.h" |
| 14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/i18n/time_formatting.h" | 16 #include "base/i18n/time_formatting.h" |
| 17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class TimeDelta; | 20 class TimeDelta; |
| 21 class TimeTicks; | 21 class TimeTicks; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace device { | |
| 25 enum class BluetoothDeviceType; | |
| 26 } | |
| 27 | |
| 28 namespace ash { | 24 namespace ash { |
| 29 struct IMEInfo; | 25 struct IMEInfo; |
| 30 struct IMEPropertyInfo; | 26 struct IMEPropertyInfo; |
| 31 | 27 |
| 32 class CustodianInfoTrayObserver; | 28 class CustodianInfoTrayObserver; |
| 33 class SystemTray; | 29 class SystemTray; |
| 34 class SystemTrayItem; | 30 class SystemTrayItem; |
| 35 | 31 |
| 36 using IMEInfoList = std::vector<IMEInfo>; | 32 using IMEInfoList = std::vector<IMEInfo>; |
| 37 using IMEPropertyInfoList = std::vector<IMEPropertyInfo>; | 33 using IMEPropertyInfoList = std::vector<IMEPropertyInfo>; |
| 38 | 34 |
| 39 // TODO(jamescook): Convert TrayBlueooth to use device::BluetoothDevice and | |
| 40 // delete this. http://crbug.com/660043 | |
| 41 struct ASH_EXPORT BluetoothDeviceInfo { | |
| 42 BluetoothDeviceInfo(); | |
| 43 BluetoothDeviceInfo(const BluetoothDeviceInfo& other); | |
| 44 ~BluetoothDeviceInfo(); | |
| 45 | |
| 46 std::string address; | |
| 47 base::string16 display_name; | |
| 48 bool connected; | |
| 49 bool connecting; | |
| 50 bool paired; | |
| 51 device::BluetoothDeviceType device_type; | |
| 52 }; | |
| 53 | |
| 54 using BluetoothDeviceList = std::vector<BluetoothDeviceInfo>; | |
| 55 | |
| 56 class NetworkingConfigDelegate; | 35 class NetworkingConfigDelegate; |
| 57 | 36 |
| 58 // SystemTrayDelegate is intended for delegating tasks in the System Tray to the | 37 // SystemTrayDelegate is intended for delegating tasks in the System Tray to the |
| 59 // application (e.g. Chrome). These tasks should be limited to application | 38 // application (e.g. Chrome). These tasks should be limited to application |
| 60 // (browser) specific tasks. For non application specific tasks, where possible, | 39 // (browser) specific tasks. For non application specific tasks, where possible, |
| 61 // components/, chromeos/, device/, etc., code should be used directly. If more | 40 // components/, chromeos/, device/, etc., code should be used directly. If more |
| 62 // than one related method is being added, consider adding an additional | 41 // than one related method is being added, consider adding an additional |
| 63 // specific delegate (e.g. CastConfigDelegate). | 42 // specific delegate (e.g. CastConfigDelegate). |
| 64 // | 43 // |
| 65 // These methods should all have trivial default implementations for platforms | 44 // These methods should all have trivial default implementations for platforms |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 91 |
| 113 // Returns true if notification tray should appear. | 92 // Returns true if notification tray should appear. |
| 114 virtual bool ShouldShowNotificationTray() const; | 93 virtual bool ShouldShowNotificationTray() const; |
| 115 | 94 |
| 116 // Shows information about enterprise enrolled devices. | 95 // Shows information about enterprise enrolled devices. |
| 117 virtual void ShowEnterpriseInfo(); | 96 virtual void ShowEnterpriseInfo(); |
| 118 | 97 |
| 119 // Shows login UI to add other users to this session. | 98 // Shows login UI to add other users to this session. |
| 120 virtual void ShowUserLogin(); | 99 virtual void ShowUserLogin(); |
| 121 | 100 |
| 122 // Returns a list of available bluetooth devices. | |
| 123 virtual void GetAvailableBluetoothDevices(BluetoothDeviceList* devices); | |
| 124 | |
| 125 // Requests bluetooth start discovering devices. | |
| 126 virtual void BluetoothStartDiscovering(); | |
| 127 | |
| 128 // Requests bluetooth stop discovering devices. | |
| 129 virtual void BluetoothStopDiscovering(); | |
| 130 | |
| 131 // Connect to a specific bluetooth device. | |
| 132 virtual void ConnectToBluetoothDevice(const std::string& address); | |
| 133 | |
| 134 // Returns true if bluetooth adapter is discovering bluetooth devices. | |
| 135 virtual bool IsBluetoothDiscovering() const; | |
| 136 | |
| 137 // Returns the currently selected IME. | 101 // Returns the currently selected IME. |
| 138 virtual void GetCurrentIME(IMEInfo* info); | 102 virtual void GetCurrentIME(IMEInfo* info); |
| 139 | 103 |
| 140 // Returns a list of availble IMEs. | 104 // Returns a list of availble IMEs. |
| 141 virtual void GetAvailableIMEList(IMEInfoList* list); | 105 virtual void GetAvailableIMEList(IMEInfoList* list); |
| 142 | 106 |
| 143 // Returns a list of properties for the currently selected IME. | 107 // Returns a list of properties for the currently selected IME. |
| 144 virtual void GetCurrentIMEProperties(IMEPropertyInfoList* list); | 108 virtual void GetCurrentIMEProperties(IMEPropertyInfoList* list); |
| 145 | 109 |
| 146 // Returns a non-empty string if IMEs are managed by policy. | 110 // Returns a non-empty string if IMEs are managed by policy. |
| 147 virtual base::string16 GetIMEManagedMessage(); | 111 virtual base::string16 GetIMEManagedMessage(); |
| 148 | 112 |
| 149 // Switches to the selected input method. | 113 // Switches to the selected input method. |
| 150 virtual void SwitchIME(const std::string& ime_id); | 114 virtual void SwitchIME(const std::string& ime_id); |
| 151 | 115 |
| 152 // Activates an IME property. | 116 // Activates an IME property. |
| 153 virtual void ActivateIMEProperty(const std::string& key); | 117 virtual void ActivateIMEProperty(const std::string& key); |
| 154 | 118 |
| 155 // Toggles bluetooth. | |
| 156 virtual void ToggleBluetooth(); | |
| 157 | |
| 158 // Returns whether bluetooth capability is available. | |
| 159 virtual bool GetBluetoothAvailable(); | |
| 160 | |
| 161 // Returns whether bluetooth is enabled. | |
| 162 virtual bool GetBluetoothEnabled(); | |
| 163 | |
| 164 // Returns whether the delegate has initiated a bluetooth discovery session. | |
| 165 virtual bool GetBluetoothDiscovering(); | |
| 166 | |
| 167 // Returns NetworkingConfigDelegate. May return nullptr. | 119 // Returns NetworkingConfigDelegate. May return nullptr. |
| 168 virtual NetworkingConfigDelegate* GetNetworkingConfigDelegate() const; | 120 virtual NetworkingConfigDelegate* GetNetworkingConfigDelegate() const; |
| 169 | 121 |
| 170 // Retrieves the session start time. Returns |false| if the time is not set. | 122 // Retrieves the session start time. Returns |false| if the time is not set. |
| 171 virtual bool GetSessionStartTime(base::TimeTicks* session_start_time); | 123 virtual bool GetSessionStartTime(base::TimeTicks* session_start_time); |
| 172 | 124 |
| 173 // Retrieves the session length limit. Returns |false| if no limit is set. | 125 // Retrieves the session length limit. Returns |false| if no limit is set. |
| 174 virtual bool GetSessionLengthLimit(base::TimeDelta* session_length_limit); | 126 virtual bool GetSessionLengthLimit(base::TimeDelta* session_length_limit); |
| 175 | 127 |
| 176 // Get the system tray menu size in pixels (dependent on the language). | 128 // Get the system tray menu size in pixels (dependent on the language). |
| (...skipping 19 matching lines...) Expand all Loading... |
| 196 // Creates a system tray item for display rotation lock. | 148 // Creates a system tray item for display rotation lock. |
| 197 // TODO(jamescook): Remove this when mus has support for display management | 149 // TODO(jamescook): Remove this when mus has support for display management |
| 198 // and we have a DisplayManager equivalent. See http://crbug.com/548429 | 150 // and we have a DisplayManager equivalent. See http://crbug.com/548429 |
| 199 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem( | 151 virtual std::unique_ptr<SystemTrayItem> CreateRotationLockTrayItem( |
| 200 SystemTray* tray); | 152 SystemTray* tray); |
| 201 }; | 153 }; |
| 202 | 154 |
| 203 } // namespace ash | 155 } // namespace ash |
| 204 | 156 |
| 205 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ | 157 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_DELEGATE_H_ |
| OLD | NEW |