| 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/ui/webui/chromeos/login/error_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
| 6 | 6 |
| 7 #include "ash/common/system/chromeos/devicetype_utils.h" | 7 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "chrome/browser/chromeos/login/screens/error_screen.h" | 10 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
| 11 #include "chrome/grit/chromium_strings.h" | 11 #include "chrome/grit/chromium_strings.h" |
| 12 #include "chrome/grit/generated_resources.h" | 12 #include "chrome/grit/generated_resources.h" |
| 13 #include "components/login/localized_values_builder.h" | 13 #include "components/login/localized_values_builder.h" |
| 14 #include "ui/strings/grit/ui_strings.h" | 14 #include "ui/strings/grit/ui_strings.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 const char kJsScreenPath[] = "login.ErrorMessageScreen"; | 18 const char kJsScreenPath[] = "login.ErrorMessageScreen"; |
| 19 | 19 |
| 20 } // namespace | 20 } // namespace |
| 21 | 21 |
| 22 namespace chromeos { | 22 namespace chromeos { |
| 23 | 23 |
| 24 ErrorScreenHandler::ErrorScreenHandler() : weak_ptr_factory_(this) { | 24 ErrorScreenHandler::ErrorScreenHandler() |
| 25 : BaseScreenHandler(kScreenId), weak_ptr_factory_(this) { |
| 25 set_call_js_prefix(kJsScreenPath); | 26 set_call_js_prefix(kJsScreenPath); |
| 26 } | 27 } |
| 27 | 28 |
| 28 ErrorScreenHandler::~ErrorScreenHandler() { | 29 ErrorScreenHandler::~ErrorScreenHandler() { |
| 29 if (screen_) | 30 if (screen_) |
| 30 screen_->OnViewDestroyed(this); | 31 screen_->OnViewDestroyed(this); |
| 31 } | 32 } |
| 32 | 33 |
| 33 void ErrorScreenHandler::Show() { | 34 void ErrorScreenHandler::Show() { |
| 34 if (!page_is_ready()) { | 35 if (!page_is_ready()) { |
| 35 show_on_init_ = true; | 36 show_on_init_ = true; |
| 36 return; | 37 return; |
| 37 } | 38 } |
| 38 BaseScreenHandler::ShowScreen(OobeScreen::SCREEN_ERROR_MESSAGE); | 39 BaseScreenHandler::ShowScreen(kScreenId); |
| 39 if (screen_) | 40 if (screen_) |
| 40 screen_->OnShow(); | 41 screen_->OnShow(); |
| 41 showing_ = true; | 42 showing_ = true; |
| 42 } | 43 } |
| 43 | 44 |
| 44 void ErrorScreenHandler::Hide() { | 45 void ErrorScreenHandler::Hide() { |
| 45 showing_ = false; | 46 showing_ = false; |
| 46 if (screen_) | 47 if (screen_) |
| 47 screen_->OnHide(); | 48 screen_->OnHide(); |
| 48 } | 49 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 if (showing_ && screen_) | 122 if (showing_ && screen_) |
| 122 screen_->OnUserAction(ErrorScreen::kUserActionConnectRequested); | 123 screen_->OnUserAction(ErrorScreen::kUserActionConnectRequested); |
| 123 } | 124 } |
| 124 | 125 |
| 125 void ErrorScreenHandler::HandleHideCaptivePortal() { | 126 void ErrorScreenHandler::HandleHideCaptivePortal() { |
| 126 if (screen_) | 127 if (screen_) |
| 127 screen_->HideCaptivePortal(); | 128 screen_->HideCaptivePortal(); |
| 128 } | 129 } |
| 129 | 130 |
| 130 } // namespace chromeos | 131 } // namespace chromeos |
| OLD | NEW |