| 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/network_error_model.h" | 10 #include "chrome/browser/chromeos/login/screens/network_error_model.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 show_on_init_(false), | 27 show_on_init_(false), |
| 28 showing_(false), | 28 showing_(false), |
| 29 weak_ptr_factory_(this) { | 29 weak_ptr_factory_(this) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 ErrorScreenHandler::~ErrorScreenHandler() { | 32 ErrorScreenHandler::~ErrorScreenHandler() { |
| 33 if (model_) | 33 if (model_) |
| 34 model_->OnViewDestroyed(this); | 34 model_->OnViewDestroyed(this); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void ErrorScreenHandler::PrepareToShow() { | |
| 38 } | |
| 39 | |
| 40 void ErrorScreenHandler::Show() { | 37 void ErrorScreenHandler::Show() { |
| 41 if (!page_is_ready()) { | 38 if (!page_is_ready()) { |
| 42 show_on_init_ = true; | 39 show_on_init_ = true; |
| 43 return; | 40 return; |
| 44 } | 41 } |
| 45 BaseScreenHandler::ShowScreen(OobeScreen::SCREEN_ERROR_MESSAGE); | 42 BaseScreenHandler::ShowScreen(OobeScreen::SCREEN_ERROR_MESSAGE); |
| 46 if (model_) | 43 if (model_) |
| 47 model_->OnShow(); | 44 model_->OnShow(); |
| 48 showing_ = true; | 45 showing_ = true; |
| 49 } | 46 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 show_on_init_ = false; | 125 show_on_init_ = false; |
| 129 } | 126 } |
| 130 } | 127 } |
| 131 | 128 |
| 132 void ErrorScreenHandler::OnConnectToNetworkRequested() { | 129 void ErrorScreenHandler::OnConnectToNetworkRequested() { |
| 133 if (showing_ && model_) | 130 if (showing_ && model_) |
| 134 model_->OnUserAction(NetworkErrorModel::kUserActionConnectRequested); | 131 model_->OnUserAction(NetworkErrorModel::kUserActionConnectRequested); |
| 135 } | 132 } |
| 136 | 133 |
| 137 } // namespace chromeos | 134 } // namespace chromeos |
| OLD | NEW |