| 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/base_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/chromeos/login/screens/base_screen.h" | 10 #include "chrome/browser/chromeos/login/screens/base_screen.h" |
| 11 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 11 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 12 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 12 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 13 #include "components/login/localized_values_builder.h" | 13 #include "components/login/localized_values_builder.h" |
| 14 #include "content/public/browser/web_ui.h" | 14 #include "content/public/browser/web_ui.h" |
| 15 | 15 |
| 16 namespace chromeos { | 16 namespace chromeos { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 const char kMethodContextChanged[] = "contextChanged"; | 19 const char kMethodContextChanged[] = "contextChanged"; |
| 20 } // namespace | 20 } // namespace |
| 21 | 21 |
| 22 BaseScreenHandler::BaseScreenHandler() | 22 BaseScreenHandler::BaseScreenHandler() = default; |
| 23 : page_is_ready_(false), base_screen_(nullptr) { | |
| 24 } | |
| 25 | |
| 26 BaseScreenHandler::BaseScreenHandler(const std::string& js_screen_path) | |
| 27 : page_is_ready_(false), | |
| 28 base_screen_(nullptr), | |
| 29 js_screen_path_prefix_(js_screen_path + ".") { | |
| 30 CHECK(!js_screen_path.empty()); | |
| 31 } | |
| 32 | 23 |
| 33 BaseScreenHandler::~BaseScreenHandler() { | 24 BaseScreenHandler::~BaseScreenHandler() { |
| 34 if (base_screen_) | 25 if (base_screen_) |
| 35 base_screen_->set_model_view_channel(nullptr); | 26 base_screen_->set_model_view_channel(nullptr); |
| 36 } | 27 } |
| 37 | 28 |
| 38 void BaseScreenHandler::InitializeBase() { | 29 void BaseScreenHandler::InitializeBase() { |
| 39 page_is_ready_ = true; | 30 page_is_ready_ = true; |
| 40 Initialize(); | 31 Initialize(); |
| 41 if (!pending_context_changes_.empty()) { | 32 if (!pending_context_changes_.empty()) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 base_screen_->OnUserAction(action_id); | 115 base_screen_->OnUserAction(action_id); |
| 125 } | 116 } |
| 126 | 117 |
| 127 void BaseScreenHandler::HandleContextChanged( | 118 void BaseScreenHandler::HandleContextChanged( |
| 128 const base::DictionaryValue* diff) { | 119 const base::DictionaryValue* diff) { |
| 129 if (diff && base_screen_) | 120 if (diff && base_screen_) |
| 130 base_screen_->OnContextChanged(*diff); | 121 base_screen_->OnContextChanged(*diff); |
| 131 } | 122 } |
| 132 | 123 |
| 133 } // namespace chromeos | 124 } // namespace chromeos |
| OLD | NEW |