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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_RESET_SCREEN_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_RESET_SCREEN_H_
10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/chromeos/login/help_app_launcher.h"
14 #include "chrome/browser/chromeos/login/screens/reset_model.h"
15 #include "chromeos/dbus/update_engine_client.h"
23 // Representation independent class that controls screen showing reset to users.
24 class ResetScreen
: public ResetModel
,
25 public UpdateEngineClient::Observer
{
27 ResetScreen(BaseScreenDelegate
* base_screen_delegate
,
29 ~ResetScreen() override
;
31 // ResetModel implementation:
32 void PrepareToShow() override
;
35 void OnViewDestroyed(ResetView
* view
) override
;
36 void OnUserAction(const std::string
& action_id
) override
;
38 // UpdateEngineClient::Observer implementation:
39 void UpdateStatusChanged(const UpdateEngineClient::Status
& status
) override
;
41 void OnRollbackCheck(bool can_rollback
);
46 STATE_RESTART_REQUIRED
= 0,
48 STATE_POWERWASH_PROPOSAL
,
55 void OnToggleRollback();
58 void OnConfirmationDismissed();
60 // Returns an instance of the error screen.
61 ErrorScreen
* GetErrorScreen();
65 // Help application used for help dialogs.
66 scoped_refptr
<HelpAppLauncher
> help_app_
;
68 base::WeakPtrFactory
<ResetScreen
> weak_ptr_factory_
;
70 DISALLOW_COPY_AND_ASSIGN(ResetScreen
);
73 } // namespace chromeos
75 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_RESET_SCREEN_H_