OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 11 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
12 #include "chrome/browser/chromeos/login/screens/reset_screen_actor.h" | 12 #include "chrome/browser/chromeos/login/screens/reset_screen_actor.h" |
13 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 13 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
14 #include "chromeos/dbus/update_engine_client.h" | 14 #include "chromeos/dbus/update_engine_client.h" |
15 #include "content/public/browser/web_ui.h" | 15 #include "content/public/browser/web_ui.h" |
16 | 16 |
| 17 class PrefRegistrySimple; |
| 18 |
17 namespace chromeos { | 19 namespace chromeos { |
18 | 20 |
19 // WebUI implementation of ResetScreenActor. | 21 // WebUI implementation of ResetScreenActor. |
20 class ResetScreenHandler : public ResetScreenActor, | 22 class ResetScreenHandler : public ResetScreenActor, |
21 public BaseScreenHandler, | 23 public BaseScreenHandler, |
22 public UpdateEngineClient::Observer { | 24 public UpdateEngineClient::Observer { |
23 public: | 25 public: |
24 ResetScreenHandler(); | 26 ResetScreenHandler(); |
25 virtual ~ResetScreenHandler(); | 27 virtual ~ResetScreenHandler(); |
26 | 28 |
27 // ResetScreenActor implementation: | 29 // ResetScreenActor implementation: |
28 virtual void PrepareToShow() OVERRIDE; | 30 virtual void PrepareToShow() OVERRIDE; |
29 virtual void Show() OVERRIDE; | 31 virtual void Show() OVERRIDE; |
30 virtual void Hide() OVERRIDE; | 32 virtual void Hide() OVERRIDE; |
31 virtual void SetDelegate(Delegate* delegate) OVERRIDE; | 33 virtual void SetDelegate(Delegate* delegate) OVERRIDE; |
32 | 34 |
33 // BaseScreenHandler implementation: | 35 // BaseScreenHandler implementation: |
34 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE; | 36 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE; |
35 virtual void Initialize() OVERRIDE; | 37 virtual void Initialize() OVERRIDE; |
36 | 38 |
37 // WebUIMessageHandler implementation: | 39 // WebUIMessageHandler implementation: |
38 virtual void RegisterMessages() OVERRIDE; | 40 virtual void RegisterMessages() OVERRIDE; |
39 | 41 |
40 // UpdateEngineClient::Observer implementation: | 42 // UpdateEngineClient::Observer implementation: |
41 virtual void UpdateStatusChanged( | 43 virtual void UpdateStatusChanged( |
42 const UpdateEngineClient::Status& status) OVERRIDE; | 44 const UpdateEngineClient::Status& status) OVERRIDE; |
43 | 45 |
44 void OnRollbackCheck(bool can_rollback); | 46 void OnRollbackCheck(bool can_rollback); |
45 | 47 |
| 48 // Registers Local State preferences. |
| 49 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 50 |
46 private: | 51 private: |
47 // JS messages handlers. | 52 // JS messages handlers. |
48 void HandleOnCancel(); | 53 void HandleOnCancel(); |
49 void HandleOnRestart(bool should_rollback); | 54 void HandleOnRestart(bool should_rollback); |
50 void HandleOnPowerwash(bool rollback_checked); | 55 void HandleOnPowerwash(bool rollback_checked); |
51 void HandleOnLearnMore(); | 56 void HandleOnLearnMore(); |
52 | 57 |
53 void ChooseAndApplyShowScenario(); | 58 void ChooseAndApplyShowScenario(); |
54 void OnRollbackFlagFileCheckDone(scoped_ptr<bool> file_exists); | 59 void OnRollbackFlagFileCheckDone(scoped_ptr<bool> file_exists); |
55 void ShowWithParams(); | 60 void ShowWithParams(); |
(...skipping 21 matching lines...) Expand all Loading... |
77 bool preparing_for_rollback_; | 82 bool preparing_for_rollback_; |
78 | 83 |
79 base::WeakPtrFactory<ResetScreenHandler> weak_ptr_factory_; | 84 base::WeakPtrFactory<ResetScreenHandler> weak_ptr_factory_; |
80 | 85 |
81 DISALLOW_COPY_AND_ASSIGN(ResetScreenHandler); | 86 DISALLOW_COPY_AND_ASSIGN(ResetScreenHandler); |
82 }; | 87 }; |
83 | 88 |
84 } // namespace chromeos | 89 } // namespace chromeos |
85 | 90 |
86 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_ | 91 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_ |
OLD | NEW |