| 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 "components/login/localized_values_builder.h" | 
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" | 
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 49     Show(); | 49     Show(); | 
| 50     show_on_init_ = false; | 50     show_on_init_ = false; | 
| 51   } | 51   } | 
| 52 } | 52 } | 
| 53 | 53 | 
| 54 void HostPairingScreenHandler::DeclareLocalizedValues( | 54 void HostPairingScreenHandler::DeclareLocalizedValues( | 
| 55     ::login::LocalizedValuesBuilder* builder) { | 55     ::login::LocalizedValuesBuilder* builder) { | 
| 56   // 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 | 
| 57   // migration. | 57   // migration. | 
| 58   std::string prefix; | 58   std::string prefix; | 
| 59   base::ReplaceChars(kJsScreenPath, ".", "_", &prefix); | 59   base::RemoveChars(kJsScreenPath, ".", &prefix); | 
| 60   prefix += "_"; |  | 
| 61 | 60 | 
| 62   builder->Add(prefix + "welcomeTitle", IDS_PAIRING_HOST_WELCOME_TITLE); | 61   builder->Add(prefix + "WelcomeTitle", IDS_PAIRING_HOST_WELCOME_TITLE); | 
| 63   builder->Add(prefix + "welcomeText", IDS_PAIRING_HOST_WELCOME_TEXT); | 62   builder->Add(prefix + "WelcomeText", IDS_PAIRING_HOST_WELCOME_TEXT); | 
| 64   builder->Add(prefix + "confirmationTitle", | 63   builder->Add(prefix + "ConfirmationTitle", | 
| 65                IDS_PAIRING_HOST_CONFIRMATION_TITLE); | 64                IDS_PAIRING_HOST_CONFIRMATION_TITLE); | 
| 66   builder->Add(prefix + "updatingTitle", IDS_PAIRING_HOST_UPDATING_TITLE); | 65   builder->Add(prefix + "UpdatingTitle", IDS_PAIRING_HOST_UPDATING_TITLE); | 
| 67   builder->Add(prefix + "updatingText", IDS_PAIRING_HOST_UPDATING_TEXT); | 66   builder->Add(prefix + "UpdatingText", IDS_PAIRING_HOST_UPDATING_TEXT); | 
| 68   builder->Add(prefix + "enrollTitle", IDS_PAIRING_ENROLL_TITLE); | 67   builder->Add(prefix + "EnrollTitle", IDS_PAIRING_ENROLL_TITLE); | 
| 69   builder->Add(prefix + "enrollingTitle", | 68   builder->Add(prefix + "EnrollingTitle", | 
| 70                IDS_PAIRING_ENROLLMENT_IN_PROGRESS); | 69                IDS_PAIRING_ENROLLMENT_IN_PROGRESS); | 
| 71   builder->Add(prefix + "doneTitle", IDS_PAIRING_HOST_DONE_TITLE); | 70   builder->Add(prefix + "DoneTitle", IDS_PAIRING_HOST_DONE_TITLE); | 
| 72   builder->Add(prefix + "doneText", IDS_PAIRING_HOST_DONE_TEXT); | 71   builder->Add(prefix + "DoneText", IDS_PAIRING_HOST_DONE_TEXT); | 
| 73   builder->Add(prefix + "enrollmentErrorTitle", | 72   builder->Add(prefix + "EnrollmentErrorTitle", | 
| 74                IDS_PAIRING_ENROLLMENT_ERROR_TITLE); | 73                IDS_PAIRING_ENROLLMENT_ERROR_TITLE); | 
| 75   builder->Add(prefix + "errorNeedsRestart", | 74   builder->Add(prefix + "ErrorNeedsRestart", | 
| 76                IDS_PAIRING_HOST_EROLLMENT_ERROR_NEEDS_RESTART); | 75                IDS_PAIRING_HOST_EROLLMENT_ERROR_NEEDS_RESTART); | 
|  | 76   builder->Add(prefix + "SetupBasicConfigTitle", | 
|  | 77                IDS_HOST_SETUP_BASIC_CONFIGURATION_TITLE); | 
|  | 78   builder->Add(prefix + "SetupNetworkErrorTitle", | 
|  | 79                IDS_HOST_SETUP_NETWORK_ERROR_TITLE); | 
| 77 } | 80 } | 
| 78 | 81 | 
| 79 void HostPairingScreenHandler::RegisterMessages() { | 82 void HostPairingScreenHandler::RegisterMessages() { | 
| 80   AddPrefixedCallback(kCallbackContextReady, | 83   AddPrefixedCallback(kCallbackContextReady, | 
| 81                       &HostPairingScreenHandler::HandleContextReady); | 84                       &HostPairingScreenHandler::HandleContextReady); | 
| 82 } | 85 } | 
| 83 | 86 | 
| 84 void HostPairingScreenHandler::Show() { | 87 void HostPairingScreenHandler::Show() { | 
| 85   if (!page_is_ready()) { | 88   if (!page_is_ready()) { | 
| 86     show_on_init_ = true; | 89     show_on_init_ = true; | 
| (...skipping 14 matching lines...) Expand all  Loading... | 
| 101 void HostPairingScreenHandler::OnContextChanged( | 104 void HostPairingScreenHandler::OnContextChanged( | 
| 102     const base::DictionaryValue& diff) { | 105     const base::DictionaryValue& diff) { | 
| 103   if (!js_context_ready_) { | 106   if (!js_context_ready_) { | 
| 104     context_cache_.ApplyChanges(diff, NULL); | 107     context_cache_.ApplyChanges(diff, NULL); | 
| 105     return; | 108     return; | 
| 106   } | 109   } | 
| 107   CallJS(kMethodContextChanged, diff); | 110   CallJS(kMethodContextChanged, diff); | 
| 108 } | 111 } | 
| 109 | 112 | 
| 110 }  // namespace chromeos | 113 }  // namespace chromeos | 
| OLD | NEW | 
|---|