| 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 #include "chrome/browser/chromeos/login/screens/update_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/update_screen.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/location.h" |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/message_loop/message_loop.h" | 13 #include "base/single_thread_task_runner.h" |
| 13 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" | 16 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" |
| 15 #include "chrome/browser/chromeos/login/screen_manager.h" | 17 #include "chrome/browser/chromeos/login/screen_manager.h" |
| 16 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 18 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
| 17 #include "chrome/browser/chromeos/login/screens/error_screen.h" | 19 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
| 18 #include "chrome/browser/chromeos/login/screens/network_error.h" | 20 #include "chrome/browser/chromeos/login/screens/network_error.h" |
| 19 #include "chrome/browser/chromeos/login/screens/update_view.h" | 21 #include "chrome/browser/chromeos/login/screens/update_view.h" |
| 20 #include "chrome/browser/chromeos/login/startup_utils.h" | 22 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 21 #include "chrome/browser/chromeos/login/wizard_controller.h" | 23 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 22 #include "chrome/grit/chromium_strings.h" | 24 #include "chrome/grit/chromium_strings.h" |
| 23 #include "chrome/grit/generated_resources.h" | 25 #include "chrome/grit/generated_resources.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 if (network && | 267 if (network && |
| 266 state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN) { | 268 state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN) { |
| 267 return; | 269 return; |
| 268 } | 270 } |
| 269 | 271 |
| 270 // Restart portal detection for the first notification about offline state. | 272 // Restart portal detection for the first notification about offline state. |
| 271 if ((!network || | 273 if ((!network || |
| 272 state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE) && | 274 state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE) && |
| 273 is_first_detection_notification_) { | 275 is_first_detection_notification_) { |
| 274 is_first_detection_notification_ = false; | 276 is_first_detection_notification_ = false; |
| 275 base::MessageLoop::current()->PostTask( | 277 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 276 FROM_HERE, | 278 FROM_HERE, |
| 277 base::Bind( | 279 base::Bind( |
| 278 base::IgnoreResult(&NetworkPortalDetector::StartDetectionIfIdle), | 280 base::IgnoreResult(&NetworkPortalDetector::StartDetectionIfIdle), |
| 279 base::Unretained(network_portal_detector::GetInstance()))); | 281 base::Unretained(network_portal_detector::GetInstance()))); |
| 280 return; | 282 return; |
| 281 } | 283 } |
| 282 is_first_detection_notification_ = false; | 284 is_first_detection_notification_ = false; |
| 283 | 285 |
| 284 NetworkPortalDetector::CaptivePortalStatus status = state.status; | 286 NetworkPortalDetector::CaptivePortalStatus status = state.status; |
| 285 if (state_ == STATE_ERROR) { | 287 if (state_ == STATE_ERROR) { |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 } | 602 } |
| 601 | 603 |
| 602 void UpdateScreen::OnConnectRequested() { | 604 void UpdateScreen::OnConnectRequested() { |
| 603 if (state_ == STATE_ERROR) { | 605 if (state_ == STATE_ERROR) { |
| 604 LOG(WARNING) << "Hiding error message since AP was reselected"; | 606 LOG(WARNING) << "Hiding error message since AP was reselected"; |
| 605 StartUpdateCheck(); | 607 StartUpdateCheck(); |
| 606 } | 608 } |
| 607 } | 609 } |
| 608 | 610 |
| 609 } // namespace chromeos | 611 } // namespace chromeos |
| OLD | NEW |