| 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_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_SCREEN_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/callback.h" | 14 #include "base/callback.h" |
| 14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/scoped_ptr.h" | |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "chrome/browser/chromeos/device/input_service_proxy.h" | 18 #include "chrome/browser/chromeos/device/input_service_proxy.h" |
| 19 #include "chrome/browser/chromeos/login/screens/base_screen.h" | 19 #include "chrome/browser/chromeos/login/screens/base_screen.h" |
| 20 #include "chrome/browser/chromeos/login/screens/hid_detection_model.h" | 20 #include "chrome/browser/chromeos/login/screens/hid_detection_model.h" |
| 21 #include "components/login/screens/screen_context.h" | 21 #include "components/login/screens/screen_context.h" |
| 22 #include "device/bluetooth/bluetooth_adapter.h" | 22 #include "device/bluetooth/bluetooth_adapter.h" |
| 23 #include "device/bluetooth/bluetooth_device.h" | 23 #include "device/bluetooth/bluetooth_device.h" |
| 24 #include "device/bluetooth/bluetooth_discovery_session.h" | 24 #include "device/bluetooth/bluetooth_discovery_session.h" |
| 25 #include "device/hid/input_service_linux.h" | 25 #include "device/hid/input_service_linux.h" |
| 26 | 26 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // tries to connect some BT device if no appropriate devices are connected. | 126 // tries to connect some BT device if no appropriate devices are connected. |
| 127 void UpdateDevices(); | 127 void UpdateDevices(); |
| 128 | 128 |
| 129 // Tries to connect some BT devices if no type-appropriate devices are | 129 // Tries to connect some BT devices if no type-appropriate devices are |
| 130 // connected. | 130 // connected. |
| 131 void UpdateBTDevices(); | 131 void UpdateBTDevices(); |
| 132 | 132 |
| 133 // Called by device::BluetoothAdapter in response to a successful request | 133 // Called by device::BluetoothAdapter in response to a successful request |
| 134 // to initiate a discovery session. | 134 // to initiate a discovery session. |
| 135 void OnStartDiscoverySession( | 135 void OnStartDiscoverySession( |
| 136 scoped_ptr<device::BluetoothDiscoverySession> discovery_session); | 136 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session); |
| 137 | 137 |
| 138 // Called by device::BluetoothAdapter in response to a failure to | 138 // Called by device::BluetoothAdapter in response to a failure to |
| 139 // initiate a discovery session. | 139 // initiate a discovery session. |
| 140 void FindDevicesError(); | 140 void FindDevicesError(); |
| 141 | 141 |
| 142 // Called by device::BluetoothAdapter in response to a failure to | 142 // Called by device::BluetoothAdapter in response to a failure to |
| 143 // power BT adapter. | 143 // power BT adapter. |
| 144 void SetPoweredError(); | 144 void SetPoweredError(); |
| 145 | 145 |
| 146 // Called by device::BluetoothAdapter in response to a failure to | 146 // Called by device::BluetoothAdapter in response to a failure to |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 HIDDetectionView* view_; | 181 HIDDetectionView* view_; |
| 182 | 182 |
| 183 // Default bluetooth adapter, used for all operations. | 183 // Default bluetooth adapter, used for all operations. |
| 184 scoped_refptr<device::BluetoothAdapter> adapter_; | 184 scoped_refptr<device::BluetoothAdapter> adapter_; |
| 185 | 185 |
| 186 InputServiceProxy input_service_proxy_; | 186 InputServiceProxy input_service_proxy_; |
| 187 | 187 |
| 188 // The current device discovery session. Only one active discovery session is | 188 // The current device discovery session. Only one active discovery session is |
| 189 // kept at a time and the instance that |discovery_session_| points to gets | 189 // kept at a time and the instance that |discovery_session_| points to gets |
| 190 // replaced by a new one when a new discovery session is initiated. | 190 // replaced by a new one when a new discovery session is initiated. |
| 191 scoped_ptr<device::BluetoothDiscoverySession> discovery_session_; | 191 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; |
| 192 | 192 |
| 193 // Current pointing device, if any. Device name is kept in screen context. | 193 // Current pointing device, if any. Device name is kept in screen context. |
| 194 std::string pointing_device_id_; | 194 std::string pointing_device_id_; |
| 195 bool mouse_is_pairing_; | 195 bool mouse_is_pairing_; |
| 196 InputDeviceInfo::Type pointing_device_connect_type_; | 196 InputDeviceInfo::Type pointing_device_connect_type_; |
| 197 | 197 |
| 198 // Current keyboard device, if any. Device name is kept in screen context. | 198 // Current keyboard device, if any. Device name is kept in screen context. |
| 199 std::string keyboard_device_id_; | 199 std::string keyboard_device_id_; |
| 200 bool keyboard_is_pairing_; | 200 bool keyboard_is_pairing_; |
| 201 InputDeviceInfo::Type keyboard_device_connect_type_; | 201 InputDeviceInfo::Type keyboard_device_connect_type_; |
| 202 std::string keyboard_device_name_; | 202 std::string keyboard_device_name_; |
| 203 | 203 |
| 204 // State of BT adapter before screen-initiated changes. | 204 // State of BT adapter before screen-initiated changes. |
| 205 scoped_ptr<bool> adapter_initially_powered_; | 205 std::unique_ptr<bool> adapter_initially_powered_; |
| 206 | 206 |
| 207 bool switch_on_adapter_when_ready_; | 207 bool switch_on_adapter_when_ready_; |
| 208 | 208 |
| 209 bool showing_; | 209 bool showing_; |
| 210 | 210 |
| 211 base::WeakPtrFactory<HIDDetectionScreen> weak_ptr_factory_; | 211 base::WeakPtrFactory<HIDDetectionScreen> weak_ptr_factory_; |
| 212 | 212 |
| 213 DISALLOW_COPY_AND_ASSIGN(HIDDetectionScreen); | 213 DISALLOW_COPY_AND_ASSIGN(HIDDetectionScreen); |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 } // namespace chromeos | 216 } // namespace chromeos |
| 217 | 217 |
| 218 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_SCREEN_H_ | 218 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_SCREEN_H_ |
| OLD | NEW |