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/update_screen_actor.h" | 16 #include "chrome/browser/chromeos/login/screens/update_screen_actor.h" |
17 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" | 17 #include "chrome/browser/chromeos/login/screens/wizard_screen.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 | 21 |
21 namespace chromeos { | 22 namespace chromeos { |
22 | 23 |
23 class ErrorScreen; | 24 class ErrorScreen; |
24 class NetworkState; | 25 class NetworkState; |
25 class ScreenManager; | 26 class ScreenManager; |
26 class ScreenObserver; | 27 class ScreenObserver; |
27 | 28 |
28 // Controller for the update screen. It does not depend on the specific | 29 // Controller for the update screen. It does not depend on the specific |
29 // implementation of the screen showing (Views of WebUI based), the dependency | 30 // implementation of the screen showing (Views of WebUI based), the dependency |
30 // is moved to the UpdateScreenActor instead. | 31 // is moved to the UpdateScreenActor instead. |
31 class UpdateScreen: public UpdateEngineClient::Observer, | 32 class UpdateScreen: public UpdateEngineClient::Observer, |
32 public UpdateScreenActor::Delegate, | 33 public UpdateScreenActor::Delegate, |
33 public WizardScreen, | 34 public WizardScreen, |
34 public NetworkPortalDetector::Observer { | 35 public NetworkPortalDetector::Observer { |
35 public: | 36 public: |
36 UpdateScreen(ScreenObserver* screen_observer, UpdateScreenActor* actor); | 37 UpdateScreen(ScreenObserver* screen_observer, UpdateScreenActor* actor, |
38 pairing_chromeos::HostPairingController* remora_controller); | |
Zachary Kuznia
2014/10/14 00:23:42
Fix the indent here.
achuithb
2014/10/14 01:42:10
Done.
| |
37 virtual ~UpdateScreen(); | 39 virtual ~UpdateScreen(); |
38 | 40 |
39 static UpdateScreen* Get(ScreenManager* manager); | 41 static UpdateScreen* Get(ScreenManager* manager); |
40 | 42 |
41 // Overridden from WizardScreen. | 43 // Overridden from WizardScreen. |
42 virtual void PrepareToShow() override; | 44 virtual void PrepareToShow() override; |
43 virtual void Show() override; | 45 virtual void Show() override; |
44 virtual void Hide() override; | 46 virtual void Hide() override; |
45 virtual std::string GetName() const override; | 47 virtual std::string GetName() const override; |
46 | 48 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 // Returns true if there is critical system update that requires installation | 100 // Returns true if there is critical system update that requires installation |
99 // and immediate reboot. | 101 // and immediate reboot. |
100 bool HasCriticalUpdate(); | 102 bool HasCriticalUpdate(); |
101 | 103 |
102 // Timer notification handlers. | 104 // Timer notification handlers. |
103 void OnWaitForRebootTimeElapsed(); | 105 void OnWaitForRebootTimeElapsed(); |
104 | 106 |
105 // Checks that screen is shown, shows if not. | 107 // Checks that screen is shown, shows if not. |
106 void MakeSureScreenIsShown(); | 108 void MakeSureScreenIsShown(); |
107 | 109 |
110 // Send update status to host pairing controller. | |
111 void SetHostPairingControllerStatus( | |
112 pairing_chromeos::HostPairingController::UpdateStatus update_status); | |
113 | |
108 // Returns an instance of the error screen. | 114 // Returns an instance of the error screen. |
109 ErrorScreen* GetErrorScreen(); | 115 ErrorScreen* GetErrorScreen(); |
110 | 116 |
111 void StartUpdateCheck(); | 117 void StartUpdateCheck(); |
112 void ShowErrorMessage(); | 118 void ShowErrorMessage(); |
113 void HideErrorMessage(); | 119 void HideErrorMessage(); |
114 void UpdateErrorMessage( | 120 void UpdateErrorMessage( |
115 const NetworkState* network, | 121 const NetworkState* network, |
116 const NetworkPortalDetector::CaptivePortalStatus status); | 122 const NetworkPortalDetector::CaptivePortalStatus status); |
117 // Timer for the interval to wait for the reboot. | 123 // Timer for the interval to wait for the reboot. |
(...skipping 20 matching lines...) Expand all Loading... | |
138 // Note, this is false by default. | 144 // Note, this is false by default. |
139 bool is_ignore_update_deadlines_; | 145 bool is_ignore_update_deadlines_; |
140 // Whether the update screen is shown. | 146 // Whether the update screen is shown. |
141 bool is_shown_; | 147 bool is_shown_; |
142 // Ignore fist IDLE status that is sent before update screen initiated check. | 148 // Ignore fist IDLE status that is sent before update screen initiated check. |
143 bool ignore_idle_status_; | 149 bool ignore_idle_status_; |
144 | 150 |
145 // Keeps actor which is delegated with all showing operations. | 151 // Keeps actor which is delegated with all showing operations. |
146 UpdateScreenActor* actor_; | 152 UpdateScreenActor* actor_; |
147 | 153 |
154 // Used to track updates over Bluetooth. | |
155 pairing_chromeos::HostPairingController* remora_controller_; | |
156 | |
148 // Time of the first notification from the downloading stage. | 157 // Time of the first notification from the downloading stage. |
149 base::Time download_start_time_; | 158 base::Time download_start_time_; |
150 double download_start_progress_; | 159 double download_start_progress_; |
151 | 160 |
152 // Time of the last notification from the downloading stage. | 161 // Time of the last notification from the downloading stage. |
153 base::Time download_last_time_; | 162 base::Time download_last_time_; |
154 double download_last_progress_; | 163 double download_last_progress_; |
155 | 164 |
156 bool is_download_average_speed_computed_; | 165 bool is_download_average_speed_computed_; |
157 double download_average_speed_; | 166 double download_average_speed_; |
158 | 167 |
159 // True if there was no notification from NetworkPortalDetector | 168 // True if there was no notification from NetworkPortalDetector |
160 // about state for the default network. | 169 // about state for the default network. |
161 bool is_first_detection_notification_; | 170 bool is_first_detection_notification_; |
162 | 171 |
163 // True if there was no notification about captive portal state for | 172 // True if there was no notification about captive portal state for |
164 // the default network. | 173 // the default network. |
165 bool is_first_portal_notification_; | 174 bool is_first_portal_notification_; |
166 | 175 |
167 base::WeakPtrFactory<UpdateScreen> weak_factory_; | 176 base::WeakPtrFactory<UpdateScreen> weak_factory_; |
168 | 177 |
169 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); | 178 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); |
170 }; | 179 }; |
171 | 180 |
172 } // namespace chromeos | 181 } // namespace chromeos |
173 | 182 |
174 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ | 183 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ |
OLD | NEW |