| 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); |
| 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 ChooseAndApplyShowScenario(); |
| 61 void ShowWithParams(); |
| 62 void EnableChromeDevFeatures(const std::string& password); |
| 63 |
| 64 // Callback for DebugDaemonClient::EnableDebuggingFeatures(). |
| 65 void OnEnableDebuggingFeatures(bool success); |
| 66 |
| 67 // Callback for DebugDaemonClient::QueryDebuggingFeatures(). |
| 68 void OnQueryDebuggingFeatures(bool success, int features_flag); |
| 69 |
| 70 // Callback for DebugDaemonClient::RemoveRootfsVerification(). |
| 71 void OnRemoveRootfsVerification(bool success); |
| 72 |
| 73 // Updates UI state. |
| 74 void UpdateUIState(UIState state); |
| 75 |
| 76 Delegate* delegate_; |
| 77 |
| 78 // Help application used for help dialogs. |
| 79 scoped_refptr<HelpAppLauncher> help_app_; |
| 80 |
| 81 // Keeps whether screen should be shown right after initialization. |
| 82 bool show_on_init_; |
| 83 bool ready_for_setup_; |
| 84 |
| 85 base::WeakPtrFactory<EnableDebuggingScreenHandler> weak_ptr_factory_; |
| 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(EnableDebuggingScreenHandler); |
| 88 }; |
| 89 |
| 90 } // namespace chromeos |
| 91 |
| 92 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENABLE_DEBUGGING_SCREEN_HANDLE
R_H_ |
| OLD | NEW |