OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/settings/md_settings_localized_strings_provide
r.h" | 5 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide
r.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" | 13 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" |
14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
15 #include "chrome/grit/chromium_strings.h" | 15 #include "chrome/grit/chromium_strings.h" |
16 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
17 #include "chrome/grit/google_chrome_strings.h" | 17 #include "chrome/grit/google_chrome_strings.h" |
18 #include "chrome/grit/locale_settings.h" | 18 #include "chrome/grit/locale_settings.h" |
19 #include "chrome/grit/settings_chromium_strings.h" | 19 #include "chrome/grit/settings_chromium_strings.h" |
20 #include "chrome/grit/settings_google_chrome_strings.h" | 20 #include "chrome/grit/settings_google_chrome_strings.h" |
21 #include "chrome/grit/settings_strings.h" | 21 #include "chrome/grit/settings_strings.h" |
22 #include "components/google/core/browser/google_util.h" | 22 #include "components/google/core/browser/google_util.h" |
23 #include "content/public/browser/web_ui_data_source.h" | 23 #include "content/public/browser/web_ui_data_source.h" |
24 #include "grit/components_strings.h" | 24 #include "grit/components_strings.h" |
25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
26 | 26 |
27 #if defined(OS_CHROMEOS) | 27 #if defined(OS_CHROMEOS) |
| 28 #include "ash/system/chromeos/devicetype_utils.h" |
28 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 29 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
29 #include "chrome/browser/signin/easy_unlock_service.h" | 30 #include "chrome/browser/signin/easy_unlock_service.h" |
30 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 31 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
31 #include "components/user_manager/user.h" | 32 #include "components/user_manager/user.h" |
32 #include "components/user_manager/user_manager.h" | 33 #include "components/user_manager/user_manager.h" |
33 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" | 34 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" |
34 #endif | 35 #endif |
35 | 36 |
36 namespace { | 37 namespace { |
37 | 38 |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 {"dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY}, | 367 {"dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY}, |
367 }; | 368 }; |
368 AddLocalizedStringsBulk(html_source, localized_strings, | 369 AddLocalizedStringsBulk(html_source, localized_strings, |
369 arraysize(localized_strings)); | 370 arraysize(localized_strings)); |
370 } | 371 } |
371 | 372 |
372 #if defined(OS_CHROMEOS) | 373 #if defined(OS_CHROMEOS) |
373 void AddEasyUnlockStrings(content::WebUIDataSource* html_source) { | 374 void AddEasyUnlockStrings(content::WebUIDataSource* html_source) { |
374 LocalizedString localized_strings[] = { | 375 LocalizedString localized_strings[] = { |
375 {"easyUnlockSectionTitle", IDS_SETTINGS_EASY_UNLOCK_SECTION_TITLE}, | 376 {"easyUnlockSectionTitle", IDS_SETTINGS_EASY_UNLOCK_SECTION_TITLE}, |
376 {"easyUnlockDescription", IDS_SETTINGS_EASY_UNLOCK_DESCRIPTION}, | |
377 {"easyUnlockRequireProximityLabel", | |
378 IDS_SETTINGS_EASY_UNLOCK_REQUIRE_PROXIMITY_LABEL}, | |
379 {"easyUnlockSetupButton", IDS_SETTINGS_EASY_UNLOCK_SETUP_BUTTON}, | 377 {"easyUnlockSetupButton", IDS_SETTINGS_EASY_UNLOCK_SETUP_BUTTON}, |
380 {"easyUnlockSetupIntro", IDS_SETTINGS_EASY_UNLOCK_SETUP_INTRO}, | |
381 // Easy Unlock turn-off dialog. | 378 // Easy Unlock turn-off dialog. |
382 {"easyUnlockTurnOffButton", IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_BUTTON}, | 379 {"easyUnlockTurnOffButton", IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_BUTTON}, |
383 {"easyUnlockTurnOffTitle", IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_TITLE}, | |
384 {"easyUnlockTurnOffDescription", | |
385 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_DESCRIPTION}, | |
386 {"easyUnlockTurnOffOfflineTitle", | 380 {"easyUnlockTurnOffOfflineTitle", |
387 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_OFFLINE_TITLE}, | 381 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_OFFLINE_TITLE}, |
388 {"easyUnlockTurnOffOfflineMessage", | 382 {"easyUnlockTurnOffOfflineMessage", |
389 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_OFFLINE_MESSAGE}, | 383 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_OFFLINE_MESSAGE}, |
390 {"easyUnlockTurnOffErrorTitle", | 384 {"easyUnlockTurnOffErrorTitle", |
391 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_ERROR_TITLE}, | 385 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_ERROR_TITLE}, |
392 {"easyUnlockTurnOffErrorMessage", | 386 {"easyUnlockTurnOffErrorMessage", |
393 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_ERROR_MESSAGE}, | 387 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_ERROR_MESSAGE}, |
394 {"easyUnlockTurnOffRetryButton", | 388 {"easyUnlockTurnOffRetryButton", |
395 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_RETRY_BUTTON}, | 389 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_RETRY_BUTTON}, |
396 }; | 390 }; |
397 AddLocalizedStringsBulk(html_source, localized_strings, | 391 AddLocalizedStringsBulk(html_source, localized_strings, |
398 arraysize(localized_strings)); | 392 arraysize(localized_strings)); |
| 393 |
| 394 base::string16 device_name = |
| 395 l10n_util::GetStringUTF16(ash::GetChromeOSDeviceTypeResourceId()); |
| 396 html_source->AddString( |
| 397 "easyUnlockSetupIntro", |
| 398 l10n_util::GetStringFUTF16(IDS_SETTINGS_EASY_UNLOCK_SETUP_INTRO, |
| 399 device_name)); |
| 400 html_source->AddString( |
| 401 "easyUnlockDescription", |
| 402 l10n_util::GetStringFUTF16(IDS_SETTINGS_EASY_UNLOCK_DESCRIPTION, |
| 403 device_name)); |
| 404 html_source->AddString( |
| 405 "easyUnlockTurnOffTitle", |
| 406 l10n_util::GetStringFUTF16(IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_TITLE, |
| 407 device_name)); |
| 408 html_source->AddString( |
| 409 "easyUnlockTurnOffDescription", |
| 410 l10n_util::GetStringFUTF16(IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_DESCRIPTION, |
| 411 device_name)); |
| 412 html_source->AddString( |
| 413 "easyUnlockRequireProximityLabel", |
| 414 l10n_util::GetStringFUTF16( |
| 415 IDS_SETTINGS_EASY_UNLOCK_REQUIRE_PROXIMITY_LABEL, device_name)); |
399 } | 416 } |
400 | 417 |
401 void AddInternetStrings(content::WebUIDataSource* html_source) { | 418 void AddInternetStrings(content::WebUIDataSource* html_source) { |
402 LocalizedString localized_strings[] = { | 419 LocalizedString localized_strings[] = { |
403 {"internetPageTitle", IDS_SETTINGS_INTERNET}, | 420 {"internetPageTitle", IDS_SETTINGS_INTERNET}, |
404 {"internetDetailPageTitle", IDS_SETTINGS_INTERNET_DETAIL}, | 421 {"internetDetailPageTitle", IDS_SETTINGS_INTERNET_DETAIL}, |
405 {"internetKnownNetworksPageTitle", IDS_SETTINGS_INTERNET_KNOWN_NETWORKS}, | 422 {"internetKnownNetworksPageTitle", IDS_SETTINGS_INTERNET_KNOWN_NETWORKS}, |
406 // Required by cr_network_list_item.js. TODO(stevenjb): Add to | 423 // Required by cr_network_list_item.js. TODO(stevenjb): Add to |
407 // settings_strings.grdp or provide an alternative translation method. | 424 // settings_strings.grdp or provide an alternative translation method. |
408 // crbug.com/512214. | 425 // crbug.com/512214. |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 #endif | 862 #endif |
846 AddUsersStrings(html_source); | 863 AddUsersStrings(html_source); |
847 AddWebContentStrings(html_source); | 864 AddWebContentStrings(html_source); |
848 | 865 |
849 policy_indicator::AddLocalizedStrings(html_source); | 866 policy_indicator::AddLocalizedStrings(html_source); |
850 | 867 |
851 html_source->SetJsonPath(kLocalizedStringsFile); | 868 html_source->SetJsonPath(kLocalizedStringsFile); |
852 } | 869 } |
853 | 870 |
854 } // namespace settings | 871 } // namespace settings |
OLD | NEW |