Chromium Code Reviews| 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 #include "content/public/browser/web_ui.h" | |
|
xiyuan
2014/10/30 03:52:09
nit: seems not used?
zel
2014/10/31 01:22:26
Done.
| |
| 15 | |
| 16 class PrefRegistrySimple; | |
| 17 | |
| 18 namespace chromeos { | |
| 19 | |
| 20 // WebUI implementation of EnableDebuggingScreenActor. | |
| 21 class EnableDebuggingScreenHandler : public EnableDebuggingScreenActor, | |
| 22 public BaseScreenHandler { | |
| 23 public: | |
| 24 EnableDebuggingScreenHandler(); | |
| 25 virtual ~EnableDebuggingScreenHandler(); | |
| 26 | |
| 27 // EnableDebuggingScreenActor implementation: | |
| 28 virtual void PrepareToShow() override; | |
| 29 virtual void Show() override; | |
| 30 virtual void Hide() override; | |
| 31 virtual void SetDelegate(Delegate* delegate) override; | |
| 32 | |
| 33 // BaseScreenHandler implementation: | |
| 34 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) override; | |
| 35 virtual void Initialize() override; | |
| 36 | |
| 37 // WebUIMessageHandler implementation: | |
| 38 virtual void RegisterMessages() override; | |
| 39 | |
| 40 void OnRollbackCheck(bool can_rollback); | |
| 41 | |
| 42 // Registers Local State preferences. | |
| 43 static void RegisterPrefs(PrefRegistrySimple* registry); | |
| 44 | |
| 45 private: | |
| 46 enum UIState { | |
| 47 UI_STATE_ERROR = -1, | |
| 48 UI_STATE_REMOVE_PROTECTION = 1, | |
| 49 UI_STATE_SETUP = 2, | |
| 50 UI_STATE_WAIT = 3, | |
| 51 UI_STATE_DONE = 4, | |
| 52 }; | |
| 53 | |
| 54 // JS messages handlers. | |
| 55 void HandleOnCancel(); | |
| 56 void HandleOnDone(); | |
| 57 void HandleOnLearnMore(); | |
| 58 void HandleOnRemoveRootFSProtection(); | |
| 59 void HandleOnSetup(const std::string& password); | |
| 60 | |
| 61 void ChooseAndApplyShowScenario(); | |
| 62 void ShowWithParams(); | |
| 63 void EnableChromeDevFeatures(const std::string& password); | |
| 64 | |
| 65 // Callback for DebugDaemonClient::EnableDebuggingFeatures(). | |
| 66 void OnEnableDebuggingFeatures(bool success); | |
| 67 | |
| 68 // Callback for DebugDaemonClient::RemoveRootfsVerification(). | |
| 69 void OnRemoveRootfsVerification(bool success); | |
| 70 | |
| 71 // Updates UI state. | |
| 72 void UpdateUIState(UIState state); | |
| 73 | |
| 74 Delegate* delegate_; | |
| 75 | |
| 76 // Help application used for help dialogs. | |
| 77 scoped_refptr<HelpAppLauncher> help_app_; | |
| 78 | |
| 79 // Keeps whether screen should be shown right after initialization. | |
| 80 bool show_on_init_; | |
| 81 bool ready_for_setup_; | |
| 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 |