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/eula_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 base::DictionaryValue* localized_strings) { | 54 base::DictionaryValue* localized_strings) { |
55 localized_strings->SetString("eulaScreenTitle", | 55 localized_strings->SetString("eulaScreenTitle", |
56 l10n_util::GetStringUTF16(IDS_EULA_SCREEN_TITLE)); | 56 l10n_util::GetStringUTF16(IDS_EULA_SCREEN_TITLE)); |
57 localized_strings->SetString("checkboxLogging", | 57 localized_strings->SetString("checkboxLogging", |
58 l10n_util::GetStringUTF16(IDS_EULA_CHECKBOX_ENABLE_LOGGING)); | 58 l10n_util::GetStringUTF16(IDS_EULA_CHECKBOX_ENABLE_LOGGING)); |
59 localized_strings->SetString("back", | 59 localized_strings->SetString("back", |
60 l10n_util::GetStringUTF16(IDS_EULA_BACK_BUTTON)); | 60 l10n_util::GetStringUTF16(IDS_EULA_BACK_BUTTON)); |
61 localized_strings->SetString("acceptAgreement", | 61 localized_strings->SetString("acceptAgreement", |
62 l10n_util::GetStringUTF16(IDS_EULA_ACCEPT_AND_CONTINUE_BUTTON)); | 62 l10n_util::GetStringUTF16(IDS_EULA_ACCEPT_AND_CONTINUE_BUTTON)); |
63 localized_strings->SetString("eulaSystemInstallationSettings", | 63 localized_strings->SetString("eulaSystemInstallationSettings", |
64 l10n_util::GetStringUTF16(IDS_EULA_SYSTEM_INSTALLATION_SETTINGS)); | 64 l10n_util::GetStringUTF16(IDS_EULA_SYSTEM_SECURITY_SETTING)); |
65 localized_strings->SetString("eulaTpmDesc", | 65 localized_strings->SetString("eulaTpmDesc", |
66 l10n_util::GetStringUTF16(IDS_EULA_TPM_DESCRIPTION)); | 66 l10n_util::GetStringUTF16(IDS_EULA_TPM_DESCRIPTION)); |
67 localized_strings->SetString("eulaTpmKeyDesc", | 67 localized_strings->SetString("eulaTpmKeyDesc", |
68 l10n_util::GetStringUTF16(IDS_EULA_TPM_KEY_DESCRIPTION)); | 68 l10n_util::GetStringUTF16(IDS_EULA_TPM_KEY_DESCRIPTION)); |
69 localized_strings->SetString("eulaTpmBusy", | 69 localized_strings->SetString("eulaTpmBusy", |
70 l10n_util::GetStringUTF16(IDS_EULA_TPM_BUSY)); | 70 l10n_util::GetStringUTF16(IDS_EULA_TPM_BUSY)); |
71 #if defined(ENABLE_RLZ) | 71 #if defined(ENABLE_RLZ) |
72 localized_strings->SetString("eulaRlzDesc", | 72 localized_strings->SetString("eulaRlzDesc", |
73 l10n_util::GetStringFUTF16(IDS_EULA_RLZ_DESCRIPTION, | 73 l10n_util::GetStringFUTF16(IDS_EULA_RLZ_DESCRIPTION, |
74 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME), | 74 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME), |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 base::Unretained(this))); | 114 base::Unretained(this))); |
115 } | 115 } |
116 | 116 |
117 void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) { | 117 void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) { |
118 StringValue tpm_password_value(tpm_password); | 118 StringValue tpm_password_value(tpm_password); |
119 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTpmPassword", | 119 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTpmPassword", |
120 tpm_password_value); | 120 tpm_password_value); |
121 } | 121 } |
122 | 122 |
123 void EulaScreenHandler::HandleOnExit(const base::ListValue* args) { | 123 void EulaScreenHandler::HandleOnExit(const base::ListValue* args) { |
124 DCHECK(args->GetSize() == 3); | 124 DCHECK(args->GetSize() == 2); |
125 | 125 |
126 bool accepted = false; | 126 bool accepted = false; |
127 if (!args->GetBoolean(0, &accepted)) | 127 if (!args->GetBoolean(0, &accepted)) |
128 NOTREACHED(); | 128 NOTREACHED(); |
129 | 129 |
130 bool usage_stats_enabled = false; | 130 bool usage_stats_enabled = false; |
131 if (!args->GetBoolean(1, &usage_stats_enabled)) | 131 if (!args->GetBoolean(1, &usage_stats_enabled)) |
132 NOTREACHED(); | 132 NOTREACHED(); |
133 | 133 |
134 bool rlz_enabled = false; | |
135 if (!args->GetBoolean(2, &rlz_enabled)) | |
136 NOTREACHED(); | |
137 | |
138 if (!delegate_) | 134 if (!delegate_) |
139 return; | 135 return; |
140 | 136 |
141 delegate_->OnExit(accepted, usage_stats_enabled, rlz_enabled); | 137 delegate_->OnExit(accepted, usage_stats_enabled); |
142 } | 138 } |
143 | 139 |
144 void EulaScreenHandler::HandleOnLearnMore(const base::ListValue* args) { | 140 void EulaScreenHandler::HandleOnLearnMore(const base::ListValue* args) { |
145 if (!help_app_.get()) { | 141 if (!help_app_.get()) { |
146 help_app_ = new HelpAppLauncher(GetNativeWindow()); | 142 help_app_ = new HelpAppLauncher(GetNativeWindow()); |
147 } | 143 } |
148 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE); | 144 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE); |
149 } | 145 } |
150 | 146 |
151 void EulaScreenHandler::HandleOnInstallationSettingsPopupOpened( | 147 void EulaScreenHandler::HandleOnInstallationSettingsPopupOpened( |
152 const base::ListValue* args) { | 148 const base::ListValue* args) { |
153 if (!delegate_) | 149 if (!delegate_) |
154 return; | 150 return; |
155 delegate_->InitiatePasswordFetch(); | 151 delegate_->InitiatePasswordFetch(); |
156 } | 152 } |
157 | 153 |
158 } // namespace chromeos | 154 } // namespace chromeos |
OLD | NEW |