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/values.h" | 9 #include "base/values.h" |
9 #include "chrome/browser/chromeos/login/screens/base_screen.h" | 10 #include "chrome/browser/chromeos/login/screens/base_screen.h" |
10 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 11 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
11 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 12 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
12 #include "components/login/localized_values_builder.h" | 13 #include "components/login/localized_values_builder.h" |
13 #include "content/public/browser/web_ui.h" | 14 #include "content/public/browser/web_ui.h" |
14 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
15 | 16 |
16 namespace chromeos { | 17 namespace chromeos { |
17 | 18 |
(...skipping 18 matching lines...) Expand all Loading... |
36 void BaseScreenHandler::InitializeBase() { | 37 void BaseScreenHandler::InitializeBase() { |
37 page_is_ready_ = true; | 38 page_is_ready_ = true; |
38 Initialize(); | 39 Initialize(); |
39 if (!pending_context_changes_.empty()) { | 40 if (!pending_context_changes_.empty()) { |
40 CommitContextChanges(pending_context_changes_); | 41 CommitContextChanges(pending_context_changes_); |
41 pending_context_changes_.Clear(); | 42 pending_context_changes_.Clear(); |
42 } | 43 } |
43 } | 44 } |
44 | 45 |
45 void BaseScreenHandler::GetLocalizedStrings(base::DictionaryValue* dict) { | 46 void BaseScreenHandler::GetLocalizedStrings(base::DictionaryValue* dict) { |
46 auto builder = make_scoped_ptr(new ::login::LocalizedValuesBuilder(dict)); | 47 auto builder = base::WrapUnique(new ::login::LocalizedValuesBuilder(dict)); |
47 DeclareLocalizedValues(builder.get()); | 48 DeclareLocalizedValues(builder.get()); |
48 GetAdditionalParameters(dict); | 49 GetAdditionalParameters(dict); |
49 } | 50 } |
50 | 51 |
51 void BaseScreenHandler::RegisterMessages() { | 52 void BaseScreenHandler::RegisterMessages() { |
52 AddPrefixedCallback("userActed", | 53 AddPrefixedCallback("userActed", |
53 &BaseScreenHandler::HandleUserAction); | 54 &BaseScreenHandler::HandleUserAction); |
54 AddPrefixedCallback("contextChanged", | 55 AddPrefixedCallback("contextChanged", |
55 &BaseScreenHandler::HandleContextChanged); | 56 &BaseScreenHandler::HandleContextChanged); |
56 DeclareJSCallbacks(); | 57 DeclareJSCallbacks(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 base_screen_->OnUserAction(action_id); | 118 base_screen_->OnUserAction(action_id); |
118 } | 119 } |
119 | 120 |
120 void BaseScreenHandler::HandleContextChanged( | 121 void BaseScreenHandler::HandleContextChanged( |
121 const base::DictionaryValue* diff) { | 122 const base::DictionaryValue* diff) { |
122 if (diff && base_screen_) | 123 if (diff && base_screen_) |
123 base_screen_->OnContextChanged(*diff); | 124 base_screen_->OnContextChanged(*diff); |
124 } | 125 } |
125 | 126 |
126 } // namespace chromeos | 127 } // namespace chromeos |
OLD | NEW |