Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / hid_detection_screen_handler.h
blobd9aea379f4a94b33bbbf3f4d03f03b471d941933
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_UI_WEBUI_CHROMEOS_LOGIN_HID_DETECTION_SCREEN_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_HID_DETECTION_SCREEN_HANDLER_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/prefs/pref_registry_simple.h"
11 #include "base/values.h"
12 #include "chrome/browser/chromeos/login/screens/hid_detection_view.h"
13 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
14 #include "content/public/browser/web_ui.h"
16 namespace base {
17 class DictionaryValue;
20 namespace chromeos {
22 class CoreOobeActor;
24 // WebUI implementation of HIDDetectionScreenView.
25 class HIDDetectionScreenHandler
26 : public HIDDetectionView,
27 public BaseScreenHandler {
28 public:
30 explicit HIDDetectionScreenHandler(CoreOobeActor* core_oobe_actor);
31 ~HIDDetectionScreenHandler() override;
33 // HIDDetectionView implementation:
34 void PrepareToShow() override;
35 void Show() override;
36 void Hide() override;
37 void Bind(HIDDetectionModel& model) override;
38 void Unbind() override;
39 void CheckIsScreenRequired(
40 const base::Callback<void(bool)>& on_check_done) override;
42 // BaseScreenHandler implementation:
43 void DeclareLocalizedValues(
44 ::login::LocalizedValuesBuilder* builder) override;
45 void DeclareJSCallbacks() override;
46 void Initialize() override;
48 // Registers the preference for derelict state.
49 static void RegisterPrefs(PrefRegistrySimple* registry);
51 private:
52 // JS messages handlers.
53 void HandleOnContinue();
55 HIDDetectionModel* model_;
57 CoreOobeActor* core_oobe_actor_;
59 // Keeps whether screen should be shown right after initialization.
60 bool show_on_init_;
62 DISALLOW_COPY_AND_ASSIGN(HIDDetectionScreenHandler);
65 } // namespace chromeos
67 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_HID_DETECTION_SCREEN_HANDLER_H_