OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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_CHROMEOS_LOGIN_SCREENS_RESET_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_RESET_SCREEN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_RESET_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_RESET_SCREEN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
dzhioev (left Google)
2015/02/11 12:38:29
What this include is needed for?
merkulova
2015/02/11 15:07:17
Removed.
| |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | |
13 #include "base/memory/weak_ptr.h" | |
14 #include "chrome/browser/chromeos/login/help_app_launcher.h" | |
12 #include "chrome/browser/chromeos/login/screens/base_screen.h" | 15 #include "chrome/browser/chromeos/login/screens/base_screen.h" |
dzhioev (left Google)
2015/02/11 12:38:29
Not needed.
merkulova
2015/02/11 15:07:17
Done.
| |
13 #include "chrome/browser/chromeos/login/screens/reset_screen_actor.h" | 16 #include "chrome/browser/chromeos/login/screens/reset_model.h" |
17 #include "chromeos/dbus/update_engine_client.h" | |
18 | |
14 | 19 |
15 namespace chromeos { | 20 namespace chromeos { |
16 | 21 |
22 class ErrorScreen; | |
23 class ResetView; | |
24 | |
17 // Representation independent class that controls screen showing reset to users. | 25 // Representation independent class that controls screen showing reset to users. |
18 class ResetScreen : public BaseScreen, public ResetScreenActor::Delegate { | 26 class ResetScreen : public ResetModel, |
27 public UpdateEngineClient::Observer { | |
19 public: | 28 public: |
20 ResetScreen(BaseScreenDelegate* base_screen_delegate, | 29 ResetScreen(BaseScreenDelegate* base_screen_delegate, |
21 ResetScreenActor* actor); | 30 ResetView* view); |
22 ~ResetScreen() override; | 31 ~ResetScreen() override; |
23 | 32 |
24 // BaseScreen implementation: | 33 // ResetModel implementation: |
25 void PrepareToShow() override; | 34 void PrepareToShow() override; |
26 void Show() override; | 35 void Show() override; |
27 void Hide() override; | 36 void Hide() override; |
28 std::string GetName() const override; | 37 void OnCancel() override; |
38 void OnPowerwash() override; | |
39 void OnRestart() override; | |
40 void OnToggleRollback() override; | |
41 void OnShowConfirm() override; | |
42 void OnLearnMore() override; | |
43 void OnViewDestroyed(ResetView* view) override; | |
44 void OnUserAction(const std::string& action_id) override; | |
29 | 45 |
30 // ResetScreenActor::Delegate implementation: | 46 // UpdateEngineClient::Observer implementation: |
31 void OnExit() override; | 47 void UpdateStatusChanged(const UpdateEngineClient::Status& status) override; |
32 void OnActorDestroyed(ResetScreenActor* actor) override; | 48 |
49 void OnRollbackCheck(bool can_rollback); | |
33 | 50 |
34 private: | 51 private: |
35 ResetScreenActor* actor_; | 52 |
53 enum State { | |
54 STATE_RESTART_REQUIRED = 0, | |
55 STATE_REVERT_PROMISE, | |
56 STATE_POWERWASH_PROPOSAL, | |
57 STATE_ERROR | |
58 }; | |
59 | |
60 // Returns an instance of the error screen. | |
61 ErrorScreen* GetErrorScreen(); | |
62 | |
63 ResetView* view_; | |
64 | |
65 // Help application used for help dialogs. | |
66 scoped_refptr<HelpAppLauncher> help_app_; | |
dzhioev (left Google)
2015/02/11 12:38:29
Do you now why help_app_ is a scoped_refptr, and n
merkulova
2015/02/11 15:07:17
Because some other screens might use it.
dzhioev (left Google)
2015/02/12 12:51:58
First of all, help_app_ is a private field without
merkulova
2015/02/12 13:37:37
is_refcounted_type_and_needs_scoped_refptr as Help
| |
67 | |
68 base::WeakPtrFactory<ResetScreen> weak_ptr_factory_; | |
36 | 69 |
37 DISALLOW_COPY_AND_ASSIGN(ResetScreen); | 70 DISALLOW_COPY_AND_ASSIGN(ResetScreen); |
38 }; | 71 }; |
39 | 72 |
40 } // namespace chromeos | 73 } // namespace chromeos |
41 | 74 |
42 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_RESET_SCREEN_H_ | 75 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_RESET_SCREEN_H_ |
OLD | NEW |