| 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() | 24 ErrorScreenHandler::ErrorScreenHandler() : weak_ptr_factory_(this) { |
| 25 : BaseScreenHandler(kJsScreenPath), | 25 set_call_js_prefix(kJsScreenPath); |
| 26 weak_ptr_factory_(this) { | |
| 27 } | 26 } |
| 28 | 27 |
| 29 ErrorScreenHandler::~ErrorScreenHandler() { | 28 ErrorScreenHandler::~ErrorScreenHandler() { |
| 30 if (screen_) | 29 if (screen_) |
| 31 screen_->OnViewDestroyed(this); | 30 screen_->OnViewDestroyed(this); |
| 32 } | 31 } |
| 33 | 32 |
| 34 void ErrorScreenHandler::Show() { | 33 void ErrorScreenHandler::Show() { |
| 35 if (!page_is_ready()) { | 34 if (!page_is_ready()) { |
| 36 show_on_init_ = true; | 35 show_on_init_ = true; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 if (showing_ && screen_) | 121 if (showing_ && screen_) |
| 123 screen_->OnUserAction(ErrorScreen::kUserActionConnectRequested); | 122 screen_->OnUserAction(ErrorScreen::kUserActionConnectRequested); |
| 124 } | 123 } |
| 125 | 124 |
| 126 void ErrorScreenHandler::HandleHideCaptivePortal() { | 125 void ErrorScreenHandler::HandleHideCaptivePortal() { |
| 127 if (screen_) | 126 if (screen_) |
| 128 screen_->HideCaptivePortal(); | 127 screen_->HideCaptivePortal(); |
| 129 } | 128 } |
| 130 | 129 |
| 131 } // namespace chromeos | 130 } // namespace chromeos |
| OLD | NEW |