| 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 "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "chrome/browser/chromeos/login/screens/network_error_model.h" | 9 #include "chrome/browser/chromeos/login/screens/network_error_model.h" |
| 10 #include "chrome/grit/chromium_strings.h" | 10 #include "chrome/grit/chromium_strings.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 if (!page_is_ready()) { | 39 if (!page_is_ready()) { |
| 40 show_on_init_ = true; | 40 show_on_init_ = true; |
| 41 return; | 41 return; |
| 42 } | 42 } |
| 43 BaseScreenHandler::ShowScreen(OobeUI::kScreenErrorMessage, NULL); | 43 BaseScreenHandler::ShowScreen(OobeUI::kScreenErrorMessage, NULL); |
| 44 if (model_) | 44 if (model_) |
| 45 model_->OnShow(); | 45 model_->OnShow(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void ErrorScreenHandler::Hide() { | 48 void ErrorScreenHandler::Hide() { |
| 49 if (model_) |
| 50 model_->OnHide(); |
| 49 } | 51 } |
| 50 | 52 |
| 51 void ErrorScreenHandler::Bind(NetworkErrorModel& model) { | 53 void ErrorScreenHandler::Bind(NetworkErrorModel& model) { |
| 52 model_ = &model; | 54 model_ = &model; |
| 53 BaseScreenHandler::SetBaseScreen(model_); | 55 BaseScreenHandler::SetBaseScreen(model_); |
| 54 } | 56 } |
| 55 | 57 |
| 56 void ErrorScreenHandler::Unbind() { | 58 void ErrorScreenHandler::Unbind() { |
| 57 model_ = nullptr; | 59 model_ = nullptr; |
| 58 BaseScreenHandler::SetBaseScreen(nullptr); | 60 BaseScreenHandler::SetBaseScreen(nullptr); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 return; | 126 return; |
| 125 | 127 |
| 126 if (show_on_init_) { | 128 if (show_on_init_) { |
| 127 // TODO(nkostylev): Check that context initial state is properly passed. | 129 // TODO(nkostylev): Check that context initial state is properly passed. |
| 128 Show(); | 130 Show(); |
| 129 show_on_init_ = false; | 131 show_on_init_ = false; |
| 130 } | 132 } |
| 131 } | 133 } |
| 132 | 134 |
| 133 } // namespace chromeos | 135 } // namespace chromeos |
| OLD | NEW |