| 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/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
| 14 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" | 14 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" |
| 15 #include "chrome/browser/chromeos/login/screen_manager.h" | 15 #include "chrome/browser/chromeos/login/screen_manager.h" |
| 16 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 16 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
| 17 #include "chrome/browser/chromeos/login/screens/error_screen.h" | 17 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
| 18 #include "chrome/browser/chromeos/login/screens/network_error.h" |
| 18 #include "chrome/browser/chromeos/login/screens/update_view.h" | 19 #include "chrome/browser/chromeos/login/screens/update_view.h" |
| 19 #include "chrome/browser/chromeos/login/startup_utils.h" | 20 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 20 #include "chrome/browser/chromeos/login/wizard_controller.h" | 21 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 21 #include "chrome/grit/chromium_strings.h" | 22 #include "chrome/grit/chromium_strings.h" |
| 22 #include "chrome/grit/generated_resources.h" | 23 #include "chrome/grit/generated_resources.h" |
| 23 #include "chromeos/dbus/dbus_thread_manager.h" | 24 #include "chromeos/dbus/dbus_thread_manager.h" |
| 24 #include "chromeos/network/network_state.h" | 25 #include "chromeos/network/network_state.h" |
| 25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 27 #include "ui/base/l10n/l10n_util.h" |
| 27 | 28 |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 state_ = STATE_UPDATE; | 513 state_ = STATE_UPDATE; |
| 513 DBusThreadManager::Get()->GetUpdateEngineClient()->AddObserver(this); | 514 DBusThreadManager::Get()->GetUpdateEngineClient()->AddObserver(this); |
| 514 VLOG(1) << "Initiate update check"; | 515 VLOG(1) << "Initiate update check"; |
| 515 DBusThreadManager::Get()->GetUpdateEngineClient()->RequestUpdateCheck( | 516 DBusThreadManager::Get()->GetUpdateEngineClient()->RequestUpdateCheck( |
| 516 base::Bind(StartUpdateCallback, this)); | 517 base::Bind(StartUpdateCallback, this)); |
| 517 } | 518 } |
| 518 | 519 |
| 519 void UpdateScreen::ShowErrorMessage() { | 520 void UpdateScreen::ShowErrorMessage() { |
| 520 LOG(WARNING) << "UpdateScreen::ShowErrorMessage()"; | 521 LOG(WARNING) << "UpdateScreen::ShowErrorMessage()"; |
| 521 state_ = STATE_ERROR; | 522 state_ = STATE_ERROR; |
| 522 GetErrorScreen()->SetUIState(ErrorScreen::UI_STATE_UPDATE); | 523 GetErrorScreen()->SetUIState(NetworkError::UI_STATE_UPDATE); |
| 523 get_base_screen_delegate()->ShowErrorScreen(); | 524 get_base_screen_delegate()->ShowErrorScreen(); |
| 524 histogram_helper_->OnErrorShow(GetErrorScreen()->GetErrorState()); | 525 histogram_helper_->OnErrorShow(GetErrorScreen()->error_state()); |
| 525 } | 526 } |
| 526 | 527 |
| 527 void UpdateScreen::HideErrorMessage() { | 528 void UpdateScreen::HideErrorMessage() { |
| 528 LOG(WARNING) << "UpdateScreen::HideErrorMessage()"; | 529 LOG(WARNING) << "UpdateScreen::HideErrorMessage()"; |
| 529 get_base_screen_delegate()->HideErrorScreen(this); | 530 get_base_screen_delegate()->HideErrorScreen(this); |
| 530 histogram_helper_->OnErrorHide(); | 531 histogram_helper_->OnErrorHide(); |
| 531 } | 532 } |
| 532 | 533 |
| 533 void UpdateScreen::UpdateErrorMessage( | 534 void UpdateScreen::UpdateErrorMessage( |
| 534 const NetworkState* network, | 535 const NetworkState* network, |
| 535 const NetworkPortalDetector::CaptivePortalStatus status) { | 536 const NetworkPortalDetector::CaptivePortalStatus status) { |
| 536 switch (status) { | 537 switch (status) { |
| 537 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE: | 538 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE: |
| 538 NOTREACHED(); | 539 NOTREACHED(); |
| 539 break; | 540 break; |
| 540 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN: | 541 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN: |
| 541 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE: | 542 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE: |
| 542 GetErrorScreen()->SetErrorState(ErrorScreen::ERROR_STATE_OFFLINE, | 543 GetErrorScreen()->SetErrorState(NetworkError::ERROR_STATE_OFFLINE, |
| 543 std::string()); | 544 std::string()); |
| 544 break; | 545 break; |
| 545 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL: | 546 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL: |
| 546 DCHECK(network); | 547 DCHECK(network); |
| 547 GetErrorScreen()->SetErrorState(ErrorScreen::ERROR_STATE_PORTAL, | 548 GetErrorScreen()->SetErrorState(NetworkError::ERROR_STATE_PORTAL, |
| 548 network->name()); | 549 network->name()); |
| 549 if (is_first_portal_notification_) { | 550 if (is_first_portal_notification_) { |
| 550 is_first_portal_notification_ = false; | 551 is_first_portal_notification_ = false; |
| 551 GetErrorScreen()->FixCaptivePortal(); | 552 GetErrorScreen()->FixCaptivePortal(); |
| 552 } | 553 } |
| 553 break; | 554 break; |
| 554 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED: | 555 case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED: |
| 555 GetErrorScreen()->SetErrorState(ErrorScreen::ERROR_STATE_PROXY, | 556 GetErrorScreen()->SetErrorState(NetworkError::ERROR_STATE_PROXY, |
| 556 std::string()); | 557 std::string()); |
| 557 break; | 558 break; |
| 558 default: | 559 default: |
| 559 NOTREACHED(); | 560 NOTREACHED(); |
| 560 break; | 561 break; |
| 561 } | 562 } |
| 562 } | 563 } |
| 563 | 564 |
| 564 void UpdateScreen::SetHostPairingControllerStatus( | 565 void UpdateScreen::SetHostPairingControllerStatus( |
| 565 HostPairingController::UpdateStatus update_status) { | 566 HostPairingController::UpdateStatus update_status) { |
| 566 if (remora_controller_) { | 567 if (remora_controller_) { |
| 567 remora_controller_->OnUpdateStatusChanged(update_status); | 568 remora_controller_->OnUpdateStatusChanged(update_status); |
| 568 } | 569 } |
| 569 } | 570 } |
| 570 | 571 |
| 571 } // namespace chromeos | 572 } // namespace chromeos |
| OLD | NEW |