| 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" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 void BaseScreenHandler::InitializeBase() { | 36 void BaseScreenHandler::InitializeBase() { |
| 37 page_is_ready_ = true; | 37 page_is_ready_ = true; |
| 38 Initialize(); | 38 Initialize(); |
| 39 if (!pending_context_changes_.empty()) { | 39 if (!pending_context_changes_.empty()) { |
| 40 CommitContextChanges(pending_context_changes_); | 40 CommitContextChanges(pending_context_changes_); |
| 41 pending_context_changes_.Clear(); | 41 pending_context_changes_.Clear(); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 void BaseScreenHandler::GetLocalizedStrings(base::DictionaryValue* dict) { | 45 void BaseScreenHandler::GetLocalizedStrings(base::DictionaryValue* dict) { |
| 46 auto builder = base::WrapUnique(new ::login::LocalizedValuesBuilder(dict)); | 46 auto builder = base::MakeUnique<::login::LocalizedValuesBuilder>(dict); |
| 47 DeclareLocalizedValues(builder.get()); | 47 DeclareLocalizedValues(builder.get()); |
| 48 GetAdditionalParameters(dict); | 48 GetAdditionalParameters(dict); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void BaseScreenHandler::RegisterMessages() { | 51 void BaseScreenHandler::RegisterMessages() { |
| 52 AddPrefixedCallback("userActed", | 52 AddPrefixedCallback("userActed", |
| 53 &BaseScreenHandler::HandleUserAction); | 53 &BaseScreenHandler::HandleUserAction); |
| 54 AddPrefixedCallback("contextChanged", | 54 AddPrefixedCallback("contextChanged", |
| 55 &BaseScreenHandler::HandleContextChanged); | 55 &BaseScreenHandler::HandleContextChanged); |
| 56 DeclareJSCallbacks(); | 56 DeclareJSCallbacks(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 base_screen_->OnUserAction(action_id); | 118 base_screen_->OnUserAction(action_id); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void BaseScreenHandler::HandleContextChanged( | 121 void BaseScreenHandler::HandleContextChanged( |
| 122 const base::DictionaryValue* diff) { | 122 const base::DictionaryValue* diff) { |
| 123 if (diff && base_screen_) | 123 if (diff && base_screen_) |
| 124 base_screen_->OnContextChanged(*diff); | 124 base_screen_->OnContextChanged(*diff); |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace chromeos | 127 } // namespace chromeos |
| OLD | NEW |