Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/eula_screen_handler.cc

Issue 2856683002: cros: Replace "TPM" with "secure module" for machines without TPM. (Closed)
Patch Set: Suffixed chromeos for chromeos compiling of secure_module_*. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h ('k') | components/login/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 IDS_CREDITS_APP_DIALOG_HEIGHT_PIXELS)); 76 IDS_CREDITS_APP_DIALOG_HEIGHT_PIXELS));
77 dialog->Show(); 77 dialog->Show();
78 // The dialog object will be deleted on dialog close. 78 // The dialog object will be deleted on dialog close.
79 } 79 }
80 80
81 } // namespace 81 } // namespace
82 82
83 namespace chromeos { 83 namespace chromeos {
84 84
85 EulaScreenHandler::EulaScreenHandler(CoreOobeView* core_oobe_view) 85 EulaScreenHandler::EulaScreenHandler(CoreOobeView* core_oobe_view)
86 : BaseScreenHandler(kScreenId), core_oobe_view_(core_oobe_view) { 86 : BaseScreenHandler(kScreenId),
87 core_oobe_view_(core_oobe_view),
88 weak_factory_(this) {
87 set_call_js_prefix(kJsScreenPath); 89 set_call_js_prefix(kJsScreenPath);
88 } 90 }
89 91
90 EulaScreenHandler::~EulaScreenHandler() { 92 EulaScreenHandler::~EulaScreenHandler() {
91 if (screen_) 93 if (screen_)
92 screen_->OnViewDestroyed(this); 94 screen_->OnViewDestroyed(this);
93 } 95 }
94 96
95 void EulaScreenHandler::Show() { 97 void EulaScreenHandler::Show() {
96 if (!page_is_ready()) { 98 if (!page_is_ready()) {
(...skipping 21 matching lines...) Expand all
118 void EulaScreenHandler::DeclareLocalizedValues( 120 void EulaScreenHandler::DeclareLocalizedValues(
119 ::login::LocalizedValuesBuilder* builder) { 121 ::login::LocalizedValuesBuilder* builder) {
120 builder->Add("eulaScreenTitle", IDS_EULA_SCREEN_TITLE); 122 builder->Add("eulaScreenTitle", IDS_EULA_SCREEN_TITLE);
121 builder->Add("eulaScreenAccessibleTitle", IDS_EULA_SCREEN_ACCESSIBLE_TITLE); 123 builder->Add("eulaScreenAccessibleTitle", IDS_EULA_SCREEN_ACCESSIBLE_TITLE);
122 builder->Add("checkboxLogging", IDS_EULA_CHECKBOX_ENABLE_LOGGING); 124 builder->Add("checkboxLogging", IDS_EULA_CHECKBOX_ENABLE_LOGGING);
123 builder->Add("back", IDS_EULA_BACK_BUTTON); 125 builder->Add("back", IDS_EULA_BACK_BUTTON);
124 builder->Add("next", IDS_EULA_NEXT_BUTTON); 126 builder->Add("next", IDS_EULA_NEXT_BUTTON);
125 builder->Add("acceptAgreement", IDS_EULA_ACCEPT_AND_CONTINUE_BUTTON); 127 builder->Add("acceptAgreement", IDS_EULA_ACCEPT_AND_CONTINUE_BUTTON);
126 builder->Add("eulaSystemInstallationSettings", 128 builder->Add("eulaSystemInstallationSettings",
127 IDS_EULA_SYSTEM_SECURITY_SETTING); 129 IDS_EULA_SYSTEM_SECURITY_SETTING);
128 builder->Add("eulaTpmDesc", IDS_EULA_TPM_DESCRIPTION); 130
129 builder->Add("eulaTpmKeyDesc", IDS_EULA_TPM_KEY_DESCRIPTION); 131 builder->Add("eulaTpmDesc", IDS_EULA_SECURE_MODULE_DESCRIPTION);
130 builder->Add("eulaTpmDescPowerwash", IDS_EULA_TPM_KEY_DESCRIPTION_POWERWASH); 132 builder->Add("eulaTpmKeyDesc", IDS_EULA_SECURE_MODULE_KEY_DESCRIPTION);
131 builder->Add("eulaTpmBusy", IDS_EULA_TPM_BUSY); 133 builder->Add("eulaTpmDescPowerwash",
134 IDS_EULA_SECURE_MODULE_KEY_DESCRIPTION_POWERWASH);
135 builder->Add("eulaTpmBusy", IDS_EULA_SECURE_MODULE_BUSY);
136 ::login::GetSecureModuleUsed(base::Bind(
137 &EulaScreenHandler::UpdateLocalizedValues, weak_factory_.GetWeakPtr()));
138
132 builder->Add("eulaSystemInstallationSettingsOkButton", IDS_OK); 139 builder->Add("eulaSystemInstallationSettingsOkButton", IDS_OK);
133 builder->Add("termsOfServiceLoading", IDS_TERMS_OF_SERVICE_SCREEN_LOADING); 140 builder->Add("termsOfServiceLoading", IDS_TERMS_OF_SERVICE_SCREEN_LOADING);
134 #if BUILDFLAG(ENABLE_RLZ) 141 #if BUILDFLAG(ENABLE_RLZ)
135 builder->AddF("eulaRlzDesc", 142 builder->AddF("eulaRlzDesc",
136 IDS_EULA_RLZ_DESCRIPTION, 143 IDS_EULA_RLZ_DESCRIPTION,
137 IDS_SHORT_PRODUCT_NAME, 144 IDS_SHORT_PRODUCT_NAME,
138 IDS_PRODUCT_NAME); 145 IDS_PRODUCT_NAME);
139 builder->AddF("eulaRlzEnable", 146 builder->AddF("eulaRlzEnable",
140 IDS_EULA_RLZ_ENABLE, 147 IDS_EULA_RLZ_ENABLE,
141 IDS_SHORT_PRODUCT_OS_NAME); 148 IDS_SHORT_PRODUCT_OS_NAME);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 GetNativeWindow(), 219 GetNativeWindow(),
213 IDS_ABOUT_VERSION_LICENSE_EULA, 220 IDS_ABOUT_VERSION_LICENSE_EULA,
214 GURL(chrome::kChromeUICreditsURL)); 221 GURL(chrome::kChromeUICreditsURL));
215 } 222 }
216 223
217 void EulaScreenHandler::HandleOnInstallationSettingsPopupOpened() { 224 void EulaScreenHandler::HandleOnInstallationSettingsPopupOpened() {
218 if (screen_) 225 if (screen_)
219 screen_->InitiatePasswordFetch(); 226 screen_->InitiatePasswordFetch();
220 } 227 }
221 228
229 void EulaScreenHandler::UpdateLocalizedValues(
230 ::login::SecureModuleUsed secure_module_used) {
231 base::DictionaryValue updated_secure_module_strings;
232 auto builder = base::MakeUnique<::login::LocalizedValuesBuilder>(
233 &updated_secure_module_strings);
234 if (secure_module_used == ::login::SecureModuleUsed::TPM) {
235 builder->Add("eulaTpmDesc", IDS_EULA_TPM_DESCRIPTION);
236 builder->Add("eulaTpmKeyDesc", IDS_EULA_TPM_KEY_DESCRIPTION);
237 builder->Add("eulaTpmDescPowerwash",
238 IDS_EULA_TPM_KEY_DESCRIPTION_POWERWASH);
239 builder->Add("eulaTpmBusy", IDS_EULA_TPM_BUSY);
240 core_oobe_view_->ReloadEulaContent(updated_secure_module_strings);
241 }
242 }
243
222 } // namespace chromeos 244 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h ('k') | components/login/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698