OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/host_pairing_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/host_pairing_screen_handler.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 8 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 9 #include "components/login/localized_values_builder.h" |
9 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
10 | 11 |
11 namespace chromeos { | 12 namespace chromeos { |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 const char kJsScreenPath[] = "login.HostPairingScreen"; | 16 const char kJsScreenPath[] = "login.HostPairingScreen"; |
16 | 17 |
17 const char kMethodContextChanged[] = "contextChanged"; | 18 const char kMethodContextChanged[] = "contextChanged"; |
18 | 19 |
(...skipping 25 matching lines...) Expand all Loading... |
44 if (!page_is_ready() || !delegate_) | 45 if (!page_is_ready() || !delegate_) |
45 return; | 46 return; |
46 | 47 |
47 if (show_on_init_) { | 48 if (show_on_init_) { |
48 Show(); | 49 Show(); |
49 show_on_init_ = false; | 50 show_on_init_ = false; |
50 } | 51 } |
51 } | 52 } |
52 | 53 |
53 void HostPairingScreenHandler::DeclareLocalizedValues( | 54 void HostPairingScreenHandler::DeclareLocalizedValues( |
54 LocalizedValuesBuilder* builder) { | 55 ::login::LocalizedValuesBuilder* builder) { |
55 // TODO(dzhioev): Move the prefix logic to the base screen handler after | 56 // TODO(dzhioev): Move the prefix logic to the base screen handler after |
56 // migration. | 57 // migration. |
57 std::string prefix; | 58 std::string prefix; |
58 base::ReplaceChars(kJsScreenPath, ".", "_", &prefix); | 59 base::ReplaceChars(kJsScreenPath, ".", "_", &prefix); |
59 prefix += "_"; | 60 prefix += "_"; |
60 | 61 |
61 builder->Add(prefix + "welcomeTitle", IDS_PAIRING_HOST_WELCOME_TITLE); | 62 builder->Add(prefix + "welcomeTitle", IDS_PAIRING_HOST_WELCOME_TITLE); |
62 builder->Add(prefix + "welcomeText", IDS_PAIRING_HOST_WELCOME_TEXT); | 63 builder->Add(prefix + "welcomeText", IDS_PAIRING_HOST_WELCOME_TEXT); |
63 builder->Add(prefix + "confirmationTitle", | 64 builder->Add(prefix + "confirmationTitle", |
64 IDS_PAIRING_HOST_CONFIRMATION_TITLE); | 65 IDS_PAIRING_HOST_CONFIRMATION_TITLE); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 void HostPairingScreenHandler::OnContextChanged( | 101 void HostPairingScreenHandler::OnContextChanged( |
101 const base::DictionaryValue& diff) { | 102 const base::DictionaryValue& diff) { |
102 if (!js_context_ready_) { | 103 if (!js_context_ready_) { |
103 context_cache_.ApplyChanges(diff, NULL); | 104 context_cache_.ApplyChanges(diff, NULL); |
104 return; | 105 return; |
105 } | 106 } |
106 CallJS(kMethodContextChanged, diff); | 107 CallJS(kMethodContextChanged, diff); |
107 } | 108 } |
108 | 109 |
109 } // namespace chromeos | 110 } // namespace chromeos |
OLD | NEW |