| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 {"dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY}, | 377 {"dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY}, |
| 377 }; | 378 }; |
| 378 AddLocalizedStringsBulk(html_source, localized_strings, | 379 AddLocalizedStringsBulk(html_source, localized_strings, |
| 379 arraysize(localized_strings)); | 380 arraysize(localized_strings)); |
| 380 } | 381 } |
| 381 | 382 |
| 382 #if defined(OS_CHROMEOS) | 383 #if defined(OS_CHROMEOS) |
| 383 void AddEasyUnlockStrings(content::WebUIDataSource* html_source) { | 384 void AddEasyUnlockStrings(content::WebUIDataSource* html_source) { |
| 384 LocalizedString localized_strings[] = { | 385 LocalizedString localized_strings[] = { |
| 385 {"easyUnlockSectionTitle", IDS_SETTINGS_EASY_UNLOCK_SECTION_TITLE}, | 386 {"easyUnlockSectionTitle", IDS_SETTINGS_EASY_UNLOCK_SECTION_TITLE}, |
| 386 {"easyUnlockDescription", IDS_SETTINGS_EASY_UNLOCK_DESCRIPTION}, | |
| 387 {"easyUnlockRequireProximityLabel", | |
| 388 IDS_SETTINGS_EASY_UNLOCK_REQUIRE_PROXIMITY_LABEL}, | |
| 389 {"easyUnlockSetupButton", IDS_SETTINGS_EASY_UNLOCK_SETUP_BUTTON}, | 387 {"easyUnlockSetupButton", IDS_SETTINGS_EASY_UNLOCK_SETUP_BUTTON}, |
| 390 {"easyUnlockSetupIntro", IDS_SETTINGS_EASY_UNLOCK_SETUP_INTRO}, | |
| 391 // Easy Unlock turn-off dialog. | 388 // Easy Unlock turn-off dialog. |
| 392 {"easyUnlockTurnOffButton", IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_BUTTON}, | 389 {"easyUnlockTurnOffButton", IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_BUTTON}, |
| 393 {"easyUnlockTurnOffTitle", IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_TITLE}, | |
| 394 {"easyUnlockTurnOffDescription", | |
| 395 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_DESCRIPTION}, | |
| 396 {"easyUnlockTurnOffOfflineTitle", | 390 {"easyUnlockTurnOffOfflineTitle", |
| 397 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_OFFLINE_TITLE}, | 391 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_OFFLINE_TITLE}, |
| 398 {"easyUnlockTurnOffOfflineMessage", | 392 {"easyUnlockTurnOffOfflineMessage", |
| 399 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_OFFLINE_MESSAGE}, | 393 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_OFFLINE_MESSAGE}, |
| 400 {"easyUnlockTurnOffErrorTitle", | 394 {"easyUnlockTurnOffErrorTitle", |
| 401 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_ERROR_TITLE}, | 395 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_ERROR_TITLE}, |
| 402 {"easyUnlockTurnOffErrorMessage", | 396 {"easyUnlockTurnOffErrorMessage", |
| 403 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_ERROR_MESSAGE}, | 397 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_ERROR_MESSAGE}, |
| 404 {"easyUnlockTurnOffRetryButton", | 398 {"easyUnlockTurnOffRetryButton", |
| 405 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_RETRY_BUTTON}, | 399 IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_RETRY_BUTTON}, |
| 406 }; | 400 }; |
| 407 AddLocalizedStringsBulk(html_source, localized_strings, | 401 AddLocalizedStringsBulk(html_source, localized_strings, |
| 408 arraysize(localized_strings)); | 402 arraysize(localized_strings)); |
| 403 |
| 404 base::string16 device_name = |
| 405 l10n_util::GetStringUTF16(ash::GetChromeOSDeviceTypeResourceId()); |
| 406 html_source->AddString( |
| 407 "easyUnlockSetupIntro", |
| 408 l10n_util::GetStringFUTF16(IDS_SETTINGS_EASY_UNLOCK_SETUP_INTRO, |
| 409 device_name)); |
| 410 html_source->AddString( |
| 411 "easyUnlockDescription", |
| 412 l10n_util::GetStringFUTF16(IDS_SETTINGS_EASY_UNLOCK_DESCRIPTION, |
| 413 device_name)); |
| 414 html_source->AddString( |
| 415 "easyUnlockTurnOffTitle", |
| 416 l10n_util::GetStringFUTF16(IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_TITLE, |
| 417 device_name)); |
| 418 html_source->AddString( |
| 419 "easyUnlockTurnOffDescription", |
| 420 l10n_util::GetStringFUTF16(IDS_SETTINGS_EASY_UNLOCK_TURN_OFF_DESCRIPTION, |
| 421 device_name)); |
| 422 html_source->AddString( |
| 423 "easyUnlockRequireProximityLabel", |
| 424 l10n_util::GetStringFUTF16( |
| 425 IDS_SETTINGS_EASY_UNLOCK_REQUIRE_PROXIMITY_LABEL, device_name)); |
| 426 |
| 427 html_source->AddString("easyUnlockLearnMoreURL", |
| 428 chrome::kEasyUnlockLearnMoreUrl); |
| 409 } | 429 } |
| 410 | 430 |
| 411 void AddInternetStrings(content::WebUIDataSource* html_source) { | 431 void AddInternetStrings(content::WebUIDataSource* html_source) { |
| 412 LocalizedString localized_strings[] = { | 432 LocalizedString localized_strings[] = { |
| 413 {"internetPageTitle", IDS_SETTINGS_INTERNET}, | 433 {"internetPageTitle", IDS_SETTINGS_INTERNET}, |
| 414 {"internetDetailPageTitle", IDS_SETTINGS_INTERNET_DETAIL}, | 434 {"internetDetailPageTitle", IDS_SETTINGS_INTERNET_DETAIL}, |
| 415 {"internetKnownNetworksPageTitle", IDS_SETTINGS_INTERNET_KNOWN_NETWORKS}, | 435 {"internetKnownNetworksPageTitle", IDS_SETTINGS_INTERNET_KNOWN_NETWORKS}, |
| 416 // Required by cr_network_list_item.js. TODO(stevenjb): Add to | 436 // Required by cr_network_list_item.js. TODO(stevenjb): Add to |
| 417 // settings_strings.grdp or provide an alternative translation method. | 437 // settings_strings.grdp or provide an alternative translation method. |
| 418 // crbug.com/512214. | 438 // crbug.com/512214. |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 #endif | 875 #endif |
| 856 AddUsersStrings(html_source); | 876 AddUsersStrings(html_source); |
| 857 AddWebContentStrings(html_source); | 877 AddWebContentStrings(html_source); |
| 858 | 878 |
| 859 policy_indicator::AddLocalizedStrings(html_source); | 879 policy_indicator::AddLocalizedStrings(html_source); |
| 860 | 880 |
| 861 html_source->SetJsonPath(kLocalizedStringsFile); | 881 html_source->SetJsonPath(kLocalizedStringsFile); |
| 862 } | 882 } |
| 863 | 883 |
| 864 } // namespace settings | 884 } // namespace settings |
| OLD | NEW |