Chromium Code Reviews| Index: chrome/browser/chromeos/login/screens/hid_detection_screen.h |
| diff --git a/chrome/browser/chromeos/login/screens/hid_detection_screen.h b/chrome/browser/chromeos/login/screens/hid_detection_screen.h |
| index 162a7298b4db6973fc4067d1c39fc6bb08b0b236..abded917b00e5d31e70d956b2f4ac26e0663bd73 100644 |
| --- a/chrome/browser/chromeos/login/screens/hid_detection_screen.h |
| +++ b/chrome/browser/chromeos/login/screens/hid_detection_screen.h |
| @@ -17,7 +17,6 @@ |
| #include "base/memory/weak_ptr.h" |
| #include "chrome/browser/chromeos/device/input_service_proxy.h" |
| #include "chrome/browser/chromeos/login/screens/base_screen.h" |
| -#include "chrome/browser/chromeos/login/screens/hid_detection_model.h" |
| #include "components/login/screens/screen_context.h" |
| #include "device/bluetooth/bluetooth_adapter.h" |
| #include "device/bluetooth/bluetooth_device.h" |
| @@ -30,11 +29,21 @@ class HIDDetectionView; |
| // Representation independent class that controls screen showing warning about |
| // HID absence to users. |
| -class HIDDetectionScreen : public HIDDetectionModel, |
| +class HIDDetectionScreen : public BaseScreen, |
| public device::BluetoothAdapter::Observer, |
| public device::BluetoothDevice::PairingDelegate, |
| public InputServiceProxy::Observer { |
| public: |
| + static const char kContextKeyKeyboardState[]; |
| + static const char kContextKeyMouseState[]; |
| + static const char kContextKeyNumKeysEnteredExpected[]; |
| + static const char kContextKeyNumKeysEnteredPinCode[]; |
| + static const char kContextKeyPinCode[]; |
| + static const char kContextKeyMouseDeviceName[]; |
| + static const char kContextKeyKeyboardDeviceName[]; |
| + static const char kContextKeyKeyboardLabel[]; |
| + static const char kContextKeyContinueButtonEnabled[]; |
| + |
| typedef device::InputServiceLinux::InputDeviceInfo InputDeviceInfo; |
|
achuithb
2017/01/18 23:19:46
let's make this 'using' since you're here.
jdufault
2017/01/20 18:57:21
Done.
|
| class Delegate { |
| @@ -47,13 +56,23 @@ class HIDDetectionScreen : public HIDDetectionModel, |
| HIDDetectionView* view); |
| ~HIDDetectionScreen() override; |
| - // HIDDetectionModel implementation: |
| + // Called when continue button was clicked. |
| + void OnContinueButtonClicked(); |
| + |
| + // Checks if we should show the screen or enough devices already present. |
| + // Calls corresponding set of actions based on the bool result. |
| + void OnViewDestroyed(HIDDetectionView* view); |
| + |
| + // This method is called, when view is being destroyed. Note, if model |
|
achuithb
2017/01/18 23:19:46
This comment needs an update and better grammar. A
jdufault
2017/01/20 18:57:21
Done.
|
| + // is destroyed earlier then it has to call Unbind(). |
| + void CheckIsScreenRequired(const base::Callback<void(bool)>& on_check_done); |
| + |
| + private: |
| + friend class HIDDetectionScreenTest; |
| + |
| + // BaseScreen implementation: |
| void Show() override; |
| void Hide() override; |
| - void OnContinueButtonClicked() override; |
| - void OnViewDestroyed(HIDDetectionView* view) override; |
| - void CheckIsScreenRequired( |
| - const base::Callback<void(bool)>& on_check_done) override; |
| // device::BluetoothDevice::PairingDelegate implementation: |
| void RequestPinCode(device::BluetoothDevice* device) override; |
| @@ -81,9 +100,6 @@ class HIDDetectionScreen : public HIDDetectionModel, |
| void OnInputDeviceAdded(const InputDeviceInfo& info) override; |
| void OnInputDeviceRemoved(const std::string& id) override; |
| - private: |
| - friend class HIDDetectionScreenTest; |
| - |
| // Types of dialog leaving scenarios for UMA metric. |
| enum ContinueScenarioType { |
| // Only pointing device detected, user pressed 'Continue'. |