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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_MODEL_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_MODEL_H_
8 #include "base/callback_forward.h"
9 #include "chrome/browser/chromeos/login/screens/base_screen.h"
13 class BaseScreenDelegate
;
14 class HIDDetectionView
;
16 class HIDDetectionModel
: public BaseScreen
{
18 static const char kContextKeyKeyboardState
[];
19 static const char kContextKeyMouseState
[];
20 static const char kContextKeyNumKeysEnteredExpected
[];
21 static const char kContextKeyNumKeysEnteredPinCode
[];
22 static const char kContextKeyPinCode
[];
23 static const char kContextKeyMouseDeviceName
[];
24 static const char kContextKeyKeyboardDeviceName
[];
25 static const char kContextKeyKeyboardLabel
[];
26 static const char kContextKeyContinueButtonEnabled
[];
28 explicit HIDDetectionModel(BaseScreenDelegate
* base_screen_delegate
);
29 ~HIDDetectionModel() override
;
31 // BaseScreen implementation:
32 std::string
GetName() const override
;
34 // Called when continue button was clicked.
35 virtual void OnContinueButtonClicked() = 0;
37 // Checks if we should show the screen or enough devices already present.
38 // Calls corresponding set of actions based on the bool result.
39 virtual void CheckIsScreenRequired(
40 const base::Callback
<void(bool)>& on_check_done
) = 0;
42 // This method is called, when view is being destroyed. Note, if model
43 // is destroyed earlier then it has to call Unbind().
44 virtual void OnViewDestroyed(HIDDetectionView
* view
) = 0;
47 } // namespace chromeos
49 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HID_DETECTION_MODEL_H_