Chromium Code Reviews| Index: chrome/browser/ui/webui/chromeos/login/enable_debugging_screen_handler.h |
| diff --git a/chrome/browser/ui/webui/chromeos/login/enable_debugging_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/enable_debugging_screen_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6cae56626a69c4a748da7dbe2d8469fb92c4d8e4 |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/chromeos/login/enable_debugging_screen_handler.h |
| @@ -0,0 +1,90 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENABLE_DEBUGGING_SCREEN_HANDLER_H_ |
| +#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENABLE_DEBUGGING_SCREEN_HANDLER_H_ |
| + |
| +#include "base/compiler_specific.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "chrome/browser/chromeos/login/help_app_launcher.h" |
| +#include "chrome/browser/chromeos/login/screens/enable_debugging_screen_actor.h" |
| +#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| +#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.
|
| + |
| +class PrefRegistrySimple; |
| + |
| +namespace chromeos { |
| + |
| +// WebUI implementation of EnableDebuggingScreenActor. |
| +class EnableDebuggingScreenHandler : public EnableDebuggingScreenActor, |
| + public BaseScreenHandler { |
| + public: |
| + EnableDebuggingScreenHandler(); |
| + virtual ~EnableDebuggingScreenHandler(); |
| + |
| + // EnableDebuggingScreenActor implementation: |
| + virtual void PrepareToShow() override; |
| + virtual void Show() override; |
| + virtual void Hide() override; |
| + virtual void SetDelegate(Delegate* delegate) override; |
| + |
| + // BaseScreenHandler implementation: |
| + virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) override; |
| + virtual void Initialize() override; |
| + |
| + // WebUIMessageHandler implementation: |
| + virtual void RegisterMessages() override; |
| + |
| + void OnRollbackCheck(bool can_rollback); |
| + |
| + // Registers Local State preferences. |
| + static void RegisterPrefs(PrefRegistrySimple* registry); |
| + |
| + private: |
| + enum UIState { |
| + UI_STATE_ERROR = -1, |
| + UI_STATE_REMOVE_PROTECTION = 1, |
| + UI_STATE_SETUP = 2, |
| + UI_STATE_WAIT = 3, |
| + UI_STATE_DONE = 4, |
| + }; |
| + |
| + // JS messages handlers. |
| + void HandleOnCancel(); |
| + void HandleOnDone(); |
| + void HandleOnLearnMore(); |
| + void HandleOnRemoveRootFSProtection(); |
| + void HandleOnSetup(const std::string& password); |
| + |
| + void ChooseAndApplyShowScenario(); |
| + void ShowWithParams(); |
| + void EnableChromeDevFeatures(const std::string& password); |
| + |
| + // Callback for DebugDaemonClient::EnableDebuggingFeatures(). |
| + void OnEnableDebuggingFeatures(bool success); |
| + |
| + // Callback for DebugDaemonClient::RemoveRootfsVerification(). |
| + void OnRemoveRootfsVerification(bool success); |
| + |
| + // Updates UI state. |
| + void UpdateUIState(UIState state); |
| + |
| + Delegate* delegate_; |
| + |
| + // Help application used for help dialogs. |
| + scoped_refptr<HelpAppLauncher> help_app_; |
| + |
| + // Keeps whether screen should be shown right after initialization. |
| + bool show_on_init_; |
| + bool ready_for_setup_; |
| + |
| + base::WeakPtrFactory<EnableDebuggingScreenHandler> weak_ptr_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(EnableDebuggingScreenHandler); |
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ENABLE_DEBUGGING_SCREEN_HANDLER_H_ |