OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENABLE_DEBUGGING_SCREEN_HANDLER_H _ | |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENABLE_DEBUGGING_SCREEN_HANDLER_H _ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "chrome/browser/chromeos/login/help_app_launcher.h" | |
12 #include "chrome/browser/chromeos/login/screens/enable_debugging_screen_actor.h" | |
13 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | |
14 | |
15 class PrefRegistrySimple; | |
16 | |
17 namespace chromeos { | |
18 | |
19 // WebUI implementation of EnableDebuggingScreenActor. | |
20 class EnableDebuggingScreenHandler : public EnableDebuggingScreenActor, | |
21 public BaseScreenHandler { | |
22 public: | |
23 EnableDebuggingScreenHandler(); | |
24 virtual ~EnableDebuggingScreenHandler(); | |
25 | |
26 // EnableDebuggingScreenActor implementation: | |
27 virtual void PrepareToShow() override; | |
28 virtual void Show() override; | |
29 virtual void Hide() override; | |
30 virtual void SetDelegate(Delegate* delegate) override; | |
31 | |
32 // BaseScreenHandler implementation: | |
33 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) override; | |
34 virtual void Initialize() override; | |
35 | |
36 // WebUIMessageHandler implementation: | |
37 virtual void RegisterMessages() override; | |
38 | |
39 void OnRollbackCheck(bool can_rollback); | |
Nikita (slow)
2014/11/05 17:51:27
nit: Drop unused method.
zel
2014/11/11 01:02:28
Done.
| |
40 | |
41 // Registers Local State preferences. | |
42 static void RegisterPrefs(PrefRegistrySimple* registry); | |
43 | |
44 private: | |
45 enum UIState { | |
46 UI_STATE_ERROR = -1, | |
47 UI_STATE_REMOVE_PROTECTION = 1, | |
48 UI_STATE_SETUP = 2, | |
49 UI_STATE_WAIT = 3, | |
50 UI_STATE_DONE = 4, | |
51 }; | |
52 | |
53 // JS messages handlers. | |
54 void HandleOnCancel(); | |
55 void HandleOnDone(); | |
56 void HandleOnLearnMore(); | |
57 void HandleOnRemoveRootFSProtection(); | |
58 void HandleOnSetup(const std::string& password); | |
59 | |
60 void ShowWithParams(); | |
61 void EnableChromeDevFeatures(const std::string& password); | |
62 | |
63 // Callback for DebugDaemonClient::EnableDebuggingFeatures(). | |
64 void OnEnableDebuggingFeatures(bool success); | |
65 | |
66 // Callback for DebugDaemonClient::QueryDebuggingFeatures(). | |
67 void OnQueryDebuggingFeatures(bool success, int features_flag); | |
68 | |
69 // Callback for DebugDaemonClient::RemoveRootfsVerification(). | |
70 void OnRemoveRootfsVerification(bool success); | |
71 | |
72 // Updates UI state. | |
73 void UpdateUIState(UIState state); | |
74 | |
75 Delegate* delegate_; | |
76 | |
77 // Help application used for help dialogs. | |
78 scoped_refptr<HelpAppLauncher> help_app_; | |
79 | |
80 // Keeps whether screen should be shown right after initialization. | |
81 bool show_on_init_; | |
82 | |
83 base::WeakPtrFactory<EnableDebuggingScreenHandler> weak_ptr_factory_; | |
84 | |
85 DISALLOW_COPY_AND_ASSIGN(EnableDebuggingScreenHandler); | |
86 }; | |
87 | |
88 } // namespace chromeos | |
89 | |
90 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENABLE_DEBUGGING_SCREEN_HANDLE R_H_ | |
OLD | NEW |