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_WEBUI_CHROMEOS_LOGIN_HID_DETECTION_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_HID_DETECTION_SCREEN_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_HID_DETECTION_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_HID_DETECTION_SCREEN_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/prefs/pref_registry_simple.h" | |
14 #include "base/values.h" | 15 #include "base/values.h" |
15 #include "chrome/browser/chromeos/device/input_service_proxy.h" | 16 #include "chrome/browser/chromeos/device/input_service_proxy.h" |
16 #include "chrome/browser/chromeos/login/screens/hid_detection_screen_actor.h" | 17 #include "chrome/browser/chromeos/login/screens/hid_detection_screen_actor.h" |
17 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 18 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
18 #include "content/public/browser/web_ui.h" | 19 #include "content/public/browser/web_ui.h" |
19 #include "device/bluetooth/bluetooth_adapter.h" | 20 #include "device/bluetooth/bluetooth_adapter.h" |
20 #include "device/bluetooth/bluetooth_device.h" | 21 #include "device/bluetooth/bluetooth_device.h" |
21 #include "device/bluetooth/bluetooth_discovery_session.h" | 22 #include "device/bluetooth/bluetooth_discovery_session.h" |
22 | 23 |
23 namespace base { | 24 namespace base { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 device::BluetoothDevice* device) OVERRIDE; | 72 device::BluetoothDevice* device) OVERRIDE; |
72 virtual void DeviceChanged(device::BluetoothAdapter* adapter, | 73 virtual void DeviceChanged(device::BluetoothAdapter* adapter, |
73 device::BluetoothDevice* device) OVERRIDE; | 74 device::BluetoothDevice* device) OVERRIDE; |
74 virtual void DeviceRemoved(device::BluetoothAdapter* adapter, | 75 virtual void DeviceRemoved(device::BluetoothAdapter* adapter, |
75 device::BluetoothDevice* device) OVERRIDE; | 76 device::BluetoothDevice* device) OVERRIDE; |
76 | 77 |
77 // InputServiceProxy::Observer implementation. | 78 // InputServiceProxy::Observer implementation. |
78 virtual void OnInputDeviceAdded(const InputDeviceInfo& info) OVERRIDE; | 79 virtual void OnInputDeviceAdded(const InputDeviceInfo& info) OVERRIDE; |
79 virtual void OnInputDeviceRemoved(const std::string& id) OVERRIDE; | 80 virtual void OnInputDeviceRemoved(const std::string& id) OVERRIDE; |
80 | 81 |
82 // Registers the preference for derelict state. | |
83 static void RegisterPrefs(PrefRegistrySimple* registry); | |
84 | |
81 private: | 85 private: |
82 void InitializeAdapter(scoped_refptr<device::BluetoothAdapter> adapter); | 86 void InitializeAdapter(scoped_refptr<device::BluetoothAdapter> adapter); |
83 | 87 |
84 // Sends a notification to the Web UI of the status of available Bluetooth/USB | 88 // Sends a notification to the Web UI of the status of available Bluetooth/USB |
85 // pointing device. | 89 // pointing device. |
86 void SendPointingDeviceNotification(); | 90 void SendPointingDeviceNotification(); |
87 | 91 |
88 // Sends a notification to the Web UI of the status of available Bluetooth/USB | 92 // Sends a notification to the Web UI of the status of available Bluetooth/USB |
89 // keyboard device. | 93 // keyboard device. |
90 void SendKeyboardDeviceNotification(base::DictionaryValue* params); | 94 void SendKeyboardDeviceNotification(base::DictionaryValue* params); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 InputDeviceInfo::Type pointing_device_connect_type_; | 167 InputDeviceInfo::Type pointing_device_connect_type_; |
164 | 168 |
165 // Current keyboard device, if any. | 169 // Current keyboard device, if any. |
166 std::string keyboard_device_name_; | 170 std::string keyboard_device_name_; |
167 std::string keyboard_device_id_; | 171 std::string keyboard_device_id_; |
168 bool keyboard_is_pairing_; | 172 bool keyboard_is_pairing_; |
169 InputDeviceInfo::Type keyboard_device_connect_type_; | 173 InputDeviceInfo::Type keyboard_device_connect_type_; |
170 | 174 |
171 bool switch_on_adapter_when_ready_; | 175 bool switch_on_adapter_when_ready_; |
172 | 176 |
173 bool skip_screen_if_devices_present_; | 177 bool first_time_screen_show_; |
174 | 178 |
175 base::WeakPtrFactory<HIDDetectionScreenHandler> weak_ptr_factory_; | 179 base::WeakPtrFactory<HIDDetectionScreenHandler> weak_ptr_factory_; |
176 | 180 |
177 DISALLOW_COPY_AND_ASSIGN(HIDDetectionScreenHandler); | 181 DISALLOW_COPY_AND_ASSIGN(HIDDetectionScreenHandler); |
178 }; | 182 }; |
179 | 183 |
184 namespace hid { | |
185 | |
186 enum ContinueScenarioType { | |
ygorshenin1
2014/05/14 09:35:36
As you're using this enum only in HIDDetectionScre
merkulova
2014/05/14 13:11:05
Done.
| |
187 | |
ygorshenin1
2014/05/14 09:35:36
nit: delete blank line.
merkulova
2014/05/14 13:11:05
Done.
| |
188 // Only pointing device detected, user pressed 'Continue'. | |
189 POINTING_DEVICE_ONLY_DETECTED, | |
190 | |
191 // Only keyboard detected, user pressed 'Continue'. | |
192 KEYBOARD_DEVICE_ONLY_DETECTED, | |
193 | |
194 // All devices detected. | |
195 All_DEVICES_DETECTED, | |
196 | |
197 // Must be last enum element. | |
198 CONTINUE_SCENARIO_TYPE_SIZE | |
199 }; | |
200 | |
201 } // namespace hid | |
202 | |
180 } // namespace chromeos | 203 } // namespace chromeos |
181 | 204 |
182 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_HID_DETECTION_SCREEN_HANDLER_H _ | 205 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_HID_DETECTION_SCREEN_HANDLER_H _ |
183 | 206 |
OLD | NEW |