| 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_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
| 16 #include "chrome/browser/chromeos/login/screens/base_screen.h" | 16 #include "chrome/browser/chromeos/login/screens/base_screen.h" |
| 17 #include "chrome/browser/chromeos/login/screens/update_screen_actor.h" | 17 #include "chrome/browser/chromeos/login/screens/update_screen_actor.h" |
| 18 #include "chromeos/dbus/update_engine_client.h" | 18 #include "chromeos/dbus/update_engine_client.h" |
| 19 #include "chromeos/network/portal_detector/network_portal_detector.h" | 19 #include "chromeos/network/portal_detector/network_portal_detector.h" |
| 20 #include "components/pairing/host_pairing_controller.h" | 20 #include "components/pairing/host_pairing_controller.h" |
| 21 | 21 |
| 22 namespace chromeos { | 22 namespace chromeos { |
| 23 | 23 |
| 24 class BaseScreenDelegate; |
| 24 class ErrorScreen; | 25 class ErrorScreen; |
| 25 class ErrorScreensHistogramHelper; | 26 class ErrorScreensHistogramHelper; |
| 26 class NetworkState; | 27 class NetworkState; |
| 27 class ScreenManager; | 28 class ScreenManager; |
| 28 class ScreenObserver; | |
| 29 | 29 |
| 30 // Controller for the update screen. It does not depend on the specific | 30 // Controller for the update screen. It does not depend on the specific |
| 31 // implementation of the screen showing (Views of WebUI based), the dependency | 31 // implementation of the screen showing (Views of WebUI based), the dependency |
| 32 // is moved to the UpdateScreenActor instead. | 32 // is moved to the UpdateScreenActor instead. |
| 33 class UpdateScreen : public UpdateEngineClient::Observer, | 33 class UpdateScreen : public UpdateEngineClient::Observer, |
| 34 public UpdateScreenActor::Delegate, | 34 public UpdateScreenActor::Delegate, |
| 35 public BaseScreen, | 35 public BaseScreen, |
| 36 public NetworkPortalDetector::Observer { | 36 public NetworkPortalDetector::Observer { |
| 37 public: | 37 public: |
| 38 UpdateScreen(ScreenObserver* screen_observer, | 38 UpdateScreen(BaseScreenDelegate* base_screen_delegate, |
| 39 UpdateScreenActor* actor, | 39 UpdateScreenActor* actor, |
| 40 pairing_chromeos::HostPairingController* remora_controller); | 40 pairing_chromeos::HostPairingController* remora_controller); |
| 41 virtual ~UpdateScreen(); | 41 virtual ~UpdateScreen(); |
| 42 | 42 |
| 43 static UpdateScreen* Get(ScreenManager* manager); | 43 static UpdateScreen* Get(ScreenManager* manager); |
| 44 | 44 |
| 45 // Overridden from BaseScreen. | 45 // Overridden from BaseScreen. |
| 46 virtual void PrepareToShow() override; | 46 virtual void PrepareToShow() override; |
| 47 virtual void Show() override; | 47 virtual void Show() override; |
| 48 virtual void Hide() override; | 48 virtual void Hide() override; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 64 static bool HasInstance(UpdateScreen* inst); | 64 static bool HasInstance(UpdateScreen* inst); |
| 65 | 65 |
| 66 void SetIgnoreIdleStatus(bool ignore_idle_status); | 66 void SetIgnoreIdleStatus(bool ignore_idle_status); |
| 67 | 67 |
| 68 enum ExitReason { | 68 enum ExitReason { |
| 69 REASON_UPDATE_CANCELED = 0, | 69 REASON_UPDATE_CANCELED = 0, |
| 70 REASON_UPDATE_INIT_FAILED, | 70 REASON_UPDATE_INIT_FAILED, |
| 71 REASON_UPDATE_NON_CRITICAL, | 71 REASON_UPDATE_NON_CRITICAL, |
| 72 REASON_UPDATE_ENDED | 72 REASON_UPDATE_ENDED |
| 73 }; | 73 }; |
| 74 // Reports update results to the ScreenObserver. | 74 // Reports update results to the BaseScreenDelegate. |
| 75 virtual void ExitUpdate(ExitReason reason); | 75 virtual void ExitUpdate(ExitReason reason); |
| 76 | 76 |
| 77 // UpdateEngineClient::Observer implementation: | 77 // UpdateEngineClient::Observer implementation: |
| 78 virtual void UpdateStatusChanged( | 78 virtual void UpdateStatusChanged( |
| 79 const UpdateEngineClient::Status& status) override; | 79 const UpdateEngineClient::Status& status) override; |
| 80 | 80 |
| 81 // NetworkPortalDetector::Observer implementation: | 81 // NetworkPortalDetector::Observer implementation: |
| 82 virtual void OnPortalDetectionCompleted( | 82 virtual void OnPortalDetectionCompleted( |
| 83 const NetworkState* network, | 83 const NetworkState* network, |
| 84 const NetworkPortalDetector::CaptivePortalState& state) override; | 84 const NetworkPortalDetector::CaptivePortalState& state) override; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 scoped_ptr<ErrorScreensHistogramHelper> histogram_helper_; | 178 scoped_ptr<ErrorScreensHistogramHelper> histogram_helper_; |
| 179 | 179 |
| 180 base::WeakPtrFactory<UpdateScreen> weak_factory_; | 180 base::WeakPtrFactory<UpdateScreen> weak_factory_; |
| 181 | 181 |
| 182 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); | 182 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 } // namespace chromeos | 185 } // namespace chromeos |
| 186 | 186 |
| 187 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ | 187 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ |
| OLD | NEW |