| 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" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 void UpdateStatusChanged(const UpdateEngineClient::Status& status) override; | 70 void UpdateStatusChanged(const UpdateEngineClient::Status& status) override; |
| 71 | 71 |
| 72 // NetworkPortalDetector::Observer implementation: | 72 // NetworkPortalDetector::Observer implementation: |
| 73 void OnPortalDetectionCompleted( | 73 void OnPortalDetectionCompleted( |
| 74 const NetworkState* network, | 74 const NetworkState* network, |
| 75 const NetworkPortalDetector::CaptivePortalState& state) override; | 75 const NetworkPortalDetector::CaptivePortalState& state) override; |
| 76 | 76 |
| 77 // Skip update UI, usually used only in debug builds/tests. | 77 // Skip update UI, usually used only in debug builds/tests. |
| 78 void CancelUpdate(); | 78 void CancelUpdate(); |
| 79 | 79 |
| 80 base::OneShotTimer<UpdateScreen>& GetErrorMessageTimerForTesting(); | 80 base::OneShotTimer& GetErrorMessageTimerForTesting(); |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 FRIEND_TEST_ALL_PREFIXES(UpdateScreenTest, TestBasic); | 83 FRIEND_TEST_ALL_PREFIXES(UpdateScreenTest, TestBasic); |
| 84 FRIEND_TEST_ALL_PREFIXES(UpdateScreenTest, TestUpdateAvailable); | 84 FRIEND_TEST_ALL_PREFIXES(UpdateScreenTest, TestUpdateAvailable); |
| 85 FRIEND_TEST_ALL_PREFIXES(UpdateScreenTest, TestAPReselection); | 85 FRIEND_TEST_ALL_PREFIXES(UpdateScreenTest, TestAPReselection); |
| 86 | 86 |
| 87 enum State { | 87 enum State { |
| 88 STATE_IDLE = 0, | 88 STATE_IDLE = 0, |
| 89 STATE_FIRST_PORTAL_CHECK, | 89 STATE_FIRST_PORTAL_CHECK, |
| 90 STATE_UPDATE, | 90 STATE_UPDATE, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 119 const NetworkState* network, | 119 const NetworkState* network, |
| 120 const NetworkPortalDetector::CaptivePortalStatus status); | 120 const NetworkPortalDetector::CaptivePortalStatus status); |
| 121 | 121 |
| 122 void DelayErrorMessage(); | 122 void DelayErrorMessage(); |
| 123 | 123 |
| 124 // The user requested an attempt to connect to the network should be made. | 124 // The user requested an attempt to connect to the network should be made. |
| 125 void OnConnectRequested(); | 125 void OnConnectRequested(); |
| 126 | 126 |
| 127 // Timer for the interval to wait for the reboot. | 127 // Timer for the interval to wait for the reboot. |
| 128 // If reboot didn't happen - ask user to reboot manually. | 128 // If reboot didn't happen - ask user to reboot manually. |
| 129 base::OneShotTimer<UpdateScreen> reboot_timer_; | 129 base::OneShotTimer reboot_timer_; |
| 130 | 130 |
| 131 // Returns a static InstanceSet. | 131 // Returns a static InstanceSet. |
| 132 typedef std::set<UpdateScreen*> InstanceSet; | 132 typedef std::set<UpdateScreen*> InstanceSet; |
| 133 static InstanceSet& GetInstanceSet(); | 133 static InstanceSet& GetInstanceSet(); |
| 134 | 134 |
| 135 // Current state of the update screen. | 135 // Current state of the update screen. |
| 136 State state_; | 136 State state_; |
| 137 | 137 |
| 138 // Time in seconds after which we decide that the device has not rebooted | 138 // Time in seconds after which we decide that the device has not rebooted |
| 139 // automatically. If reboot didn't happen during this interval, ask user to | 139 // automatically. If reboot didn't happen during this interval, ask user to |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 // True if there was no notification about captive portal state for | 175 // True if there was no notification about captive portal state for |
| 176 // the default network. | 176 // the default network. |
| 177 bool is_first_portal_notification_; | 177 bool is_first_portal_notification_; |
| 178 | 178 |
| 179 scoped_ptr<ErrorScreensHistogramHelper> histogram_helper_; | 179 scoped_ptr<ErrorScreensHistogramHelper> histogram_helper_; |
| 180 | 180 |
| 181 // Timer for the captive portal detector to show portal login page. | 181 // Timer for the captive portal detector to show portal login page. |
| 182 // If redirect did not happen during this delay, error message is shown | 182 // If redirect did not happen during this delay, error message is shown |
| 183 // instead. | 183 // instead. |
| 184 base::OneShotTimer<UpdateScreen> error_message_timer_; | 184 base::OneShotTimer error_message_timer_; |
| 185 | 185 |
| 186 ErrorScreen::ConnectRequestCallbackSubscription connect_request_subscription_; | 186 ErrorScreen::ConnectRequestCallbackSubscription connect_request_subscription_; |
| 187 | 187 |
| 188 base::WeakPtrFactory<UpdateScreen> weak_factory_; | 188 base::WeakPtrFactory<UpdateScreen> weak_factory_; |
| 189 | 189 |
| 190 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); | 190 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); |
| 191 }; | 191 }; |
| 192 | 192 |
| 193 } // namespace chromeos | 193 } // namespace chromeos |
| 194 | 194 |
| 195 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ | 195 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_H_ |
| OLD | NEW |