Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UPDATE_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/timer.h" | 13 #include "base/timer.h" |
| 14 #include "chrome/browser/chromeos/cros/update_library.h" | 14 #include "chrome/browser/chromeos/cros/update_library.h" |
| 15 #include "chrome/browser/chromeos/login/update_screen_actor.h" | |
| 15 #include "chrome/browser/chromeos/login/wizard_screen.h" | 16 #include "chrome/browser/chromeos/login/wizard_screen.h" |
| 16 | 17 |
| 17 namespace chromeos { | 18 namespace chromeos { |
| 18 | 19 |
| 19 class ScreenObserver; | 20 class ScreenObserver; |
| 20 class UpdateScreenActor; | |
| 21 | 21 |
| 22 // Controller for the update screen. It does not depend on the specific | 22 // Controller for the update screen. It does not depend on the specific |
| 23 // implementation of the screen showing (Views of WebUI based), the dependency | 23 // implementation of the screen showing (Views of WebUI based), the dependency |
| 24 // is moved to the UpdateScreenActor instead. | 24 // is moved to the UpdateScreenActor instead. |
| 25 class UpdateScreen: public UpdateLibrary::Observer, | 25 class UpdateScreen: public UpdateLibrary::Observer, |
| 26 public UpdateScreenActor::Delegate, | |
| 26 public WizardScreen { | 27 public WizardScreen { |
| 27 public: | 28 public: |
| 28 UpdateScreen(ScreenObserver* screen_observer, UpdateScreenActor* actor); | 29 UpdateScreen(ScreenObserver* screen_observer, UpdateScreenActor* actor); |
| 29 virtual ~UpdateScreen(); | 30 virtual ~UpdateScreen(); |
| 30 | 31 |
| 31 // Overridden from WizardScreen. | 32 // Overridden from WizardScreen. |
| 32 virtual void PrepareToShow(); | 33 virtual void PrepareToShow(); |
| 33 virtual void Show(); | 34 virtual void Show(); |
| 34 virtual void Hide(); | 35 virtual void Hide(); |
| 35 | 36 |
| 37 // UpdateScreenActor::Delegate implementation: | |
| 38 virtual void CancelUpdate(); | |
|
whywhat
2011/08/29 17:55:51
nit: We append OVERRIDE for each new virtual metho
Ivan Korotkov
2011/08/29 18:19:17
Done.
| |
| 39 | |
| 36 // Checks for updates and performs an update if needed. Made virtual to | 40 // Checks for updates and performs an update if needed. Made virtual to |
| 37 // simplify mocking. | 41 // simplify mocking. |
| 38 virtual void StartUpdate(); | 42 virtual void StartUpdate(); |
| 39 | 43 |
| 40 // Force cancel update. Made virtual to simplify mocking. | |
| 41 virtual void CancelUpdate(); | |
| 42 | |
| 43 // Reboot check delay get/set, in seconds. | 44 // Reboot check delay get/set, in seconds. |
| 44 int reboot_check_delay() const { return reboot_check_delay_; } | 45 int reboot_check_delay() const { return reboot_check_delay_; } |
| 45 void SetRebootCheckDelay(int seconds); | 46 void SetRebootCheckDelay(int seconds); |
| 46 | 47 |
| 47 // Returns true if this instance is still active (i.e. has not been deleted). | 48 // Returns true if this instance is still active (i.e. has not been deleted). |
| 48 static bool HasInstance(UpdateScreen* inst); | 49 static bool HasInstance(UpdateScreen* inst); |
| 49 | 50 |
| 50 void SetIgnoreIdleStatus(bool ignore_idle_status); | 51 void SetIgnoreIdleStatus(bool ignore_idle_status); |
| 51 | 52 |
| 52 enum ExitReason { | 53 enum ExitReason { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 | 103 |
| 103 // Keeps actor which is delegated with all showing operations. | 104 // Keeps actor which is delegated with all showing operations. |
| 104 UpdateScreenActor* actor_; | 105 UpdateScreenActor* actor_; |
| 105 | 106 |
| 106 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); | 107 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace chromeos | 110 } // namespace chromeos |
| 110 | 111 |
| 111 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ | 112 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ |
| OLD | NEW |