| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 39 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
| 40 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" | 40 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" |
| 41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 42 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 42 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 43 #include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_pro
vider.h" | 43 #include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_pro
vider.h" |
| 44 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 44 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 45 #include "chromeos/chromeos_switches.h" | 45 #include "chromeos/chromeos_switches.h" |
| 46 #include "components/user_manager/user.h" | 46 #include "components/user_manager/user.h" |
| 47 #include "components/user_manager/user_manager.h" | 47 #include "components/user_manager/user_manager.h" |
| 48 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" | 48 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" |
| 49 #include "ui/display/display_switches.h" |
| 49 #else | 50 #else |
| 50 #include "chrome/browser/ui/webui/settings/system_handler.h" | 51 #include "chrome/browser/ui/webui/settings/system_handler.h" |
| 51 #endif | 52 #endif |
| 52 | 53 |
| 53 namespace settings { | 54 namespace settings { |
| 54 namespace { | 55 namespace { |
| 55 | 56 |
| 56 // Note that settings.html contains a <script> tag which imports a script of | 57 // Note that settings.html contains a <script> tag which imports a script of |
| 57 // the following name. These names must be kept in sync. | 58 // the following name. These names must be kept in sync. |
| 58 const char kLocalizedStringsFile[] = "strings.js"; | 59 const char kLocalizedStringsFile[] = "strings.js"; |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 {"stylusNoteTakingAppWaitingForAndroid", | 628 {"stylusNoteTakingAppWaitingForAndroid", |
| 628 IDS_SETTINGS_STYLUS_NOTE_TAKING_APP_WAITING_FOR_ANDROID}}; | 629 IDS_SETTINGS_STYLUS_NOTE_TAKING_APP_WAITING_FOR_ANDROID}}; |
| 629 AddLocalizedStringsBulk(html_source, stylus_strings, | 630 AddLocalizedStringsBulk(html_source, stylus_strings, |
| 630 arraysize(stylus_strings)); | 631 arraysize(stylus_strings)); |
| 631 | 632 |
| 632 LocalizedString display_strings[] = { | 633 LocalizedString display_strings[] = { |
| 633 {"displayTitle", IDS_SETTINGS_DISPLAY_TITLE}, | 634 {"displayTitle", IDS_SETTINGS_DISPLAY_TITLE}, |
| 634 {"displayArrangementText", IDS_SETTINGS_DISPLAY_ARRANGEMENT_TEXT}, | 635 {"displayArrangementText", IDS_SETTINGS_DISPLAY_ARRANGEMENT_TEXT}, |
| 635 {"displayArrangementTitle", IDS_SETTINGS_DISPLAY_ARRANGEMENT_TITLE}, | 636 {"displayArrangementTitle", IDS_SETTINGS_DISPLAY_ARRANGEMENT_TITLE}, |
| 636 {"displayMirror", IDS_SETTINGS_DISPLAY_MIRROR}, | 637 {"displayMirror", IDS_SETTINGS_DISPLAY_MIRROR}, |
| 637 {"displayMirrorOff", IDS_SETTINGS_DISPLAY_MIRRORING_OFF}, | 638 {"displayUnfiedDesktop", IDS_SETTINGS_DISPLAY_UNIFIED_DESKTOP}, |
| 638 {"displayMirrorOn", IDS_SETTINGS_DISPLAY_MIRRORING_ON}, | |
| 639 {"displayResolutionTitle", IDS_SETTINGS_DISPLAY_RESOLUTION_TITLE}, | 639 {"displayResolutionTitle", IDS_SETTINGS_DISPLAY_RESOLUTION_TITLE}, |
| 640 {"displayResolutionText", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT}, | 640 {"displayResolutionText", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT}, |
| 641 {"displayResolutionTextBest", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_BEST}, | 641 {"displayResolutionTextBest", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_BEST}, |
| 642 {"displayResolutionTextNative", | 642 {"displayResolutionTextNative", |
| 643 IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_NATIVE}, | 643 IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_NATIVE}, |
| 644 {"displayScreenTitle", IDS_SETTINGS_DISPLAY_SCREEN}, | 644 {"displayScreenTitle", IDS_SETTINGS_DISPLAY_SCREEN}, |
| 645 {"displayScreenExtended", IDS_SETTINGS_DISPLAY_SCREEN_EXTENDED}, | 645 {"displayScreenExtended", IDS_SETTINGS_DISPLAY_SCREEN_EXTENDED}, |
| 646 {"displayScreenPrimary", IDS_SETTINGS_DISPLAY_SCREEN_PRIMARY}, | 646 {"displayScreenPrimary", IDS_SETTINGS_DISPLAY_SCREEN_PRIMARY}, |
| 647 {"displayOrientation", IDS_SETTINGS_DISPLAY_ORIENTATION}, | 647 {"displayOrientation", IDS_SETTINGS_DISPLAY_ORIENTATION}, |
| 648 {"displayOrientationStandard", IDS_SETTINGS_DISPLAY_ORIENTATION_STANDARD}, | 648 {"displayOrientationStandard", IDS_SETTINGS_DISPLAY_ORIENTATION_STANDARD}, |
| 649 {"displayOverscanPageText", IDS_SETTINGS_DISPLAY_OVERSCAN_TEXT}, | 649 {"displayOverscanPageText", IDS_SETTINGS_DISPLAY_OVERSCAN_TEXT}, |
| 650 {"displayOverscanPageTitle", IDS_SETTINGS_DISPLAY_OVERSCAN_TITLE}, | 650 {"displayOverscanPageTitle", IDS_SETTINGS_DISPLAY_OVERSCAN_TITLE}, |
| 651 {"displayOverscanSubtitle", IDS_SETTINGS_DISPLAY_OVERSCAN_SUBTITLE}, | 651 {"displayOverscanSubtitle", IDS_SETTINGS_DISPLAY_OVERSCAN_SUBTITLE}, |
| 652 {"displayOverscanInstructions", | 652 {"displayOverscanInstructions", |
| 653 IDS_SETTINGS_DISPLAY_OVERSCAN_INSTRUCTIONS}, | 653 IDS_SETTINGS_DISPLAY_OVERSCAN_INSTRUCTIONS}, |
| 654 {"displayOverscanResize", IDS_SETTINGS_DISPLAY_OVERSCAN_RESIZE}, | 654 {"displayOverscanResize", IDS_SETTINGS_DISPLAY_OVERSCAN_RESIZE}, |
| 655 {"displayOverscanPosition", IDS_SETTINGS_DISPLAY_OVERSCAN_POSITION}, | 655 {"displayOverscanPosition", IDS_SETTINGS_DISPLAY_OVERSCAN_POSITION}, |
| 656 {"displayOverscanReset", IDS_SETTINGS_DISPLAY_OVERSCAN_RESET}, | 656 {"displayOverscanReset", IDS_SETTINGS_DISPLAY_OVERSCAN_RESET}, |
| 657 {"displayTouchCalibrationTitle", | 657 {"displayTouchCalibrationTitle", |
| 658 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TITLE}, | 658 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TITLE}, |
| 659 {"displayTouchCalibrationText", | 659 {"displayTouchCalibrationText", |
| 660 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TEXT} | 660 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TEXT} |
| 661 }; | 661 }; |
| 662 AddLocalizedStringsBulk(html_source, display_strings, | 662 AddLocalizedStringsBulk(html_source, display_strings, |
| 663 arraysize(display_strings)); | 663 arraysize(display_strings)); |
| 664 html_source->AddBoolean("unifiedDesktopAvailable", |
| 665 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 666 ::switches::kEnableUnifiedDesktop)); |
| 664 | 667 |
| 665 html_source->AddBoolean( | 668 html_source->AddBoolean( |
| 666 "enableTouchCalibrationSetting", | 669 "enableTouchCalibrationSetting", |
| 667 base::CommandLine::ForCurrentProcess()->HasSwitch( | 670 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 668 chromeos::switches::kEnableTouchCalibrationSetting)); | 671 chromeos::switches::kEnableTouchCalibrationSetting)); |
| 669 | 672 |
| 670 LocalizedString storage_strings[] = { | 673 LocalizedString storage_strings[] = { |
| 671 {"storageTitle", IDS_SETTINGS_STORAGE_TITLE}, | 674 {"storageTitle", IDS_SETTINGS_STORAGE_TITLE}, |
| 672 {"storageItemInUse", IDS_SETTINGS_STORAGE_ITEM_IN_USE}, | 675 {"storageItemInUse", IDS_SETTINGS_STORAGE_ITEM_IN_USE}, |
| 673 {"storageItemAvailable", IDS_SETTINGS_STORAGE_ITEM_AVAILABLE}, | 676 {"storageItemAvailable", IDS_SETTINGS_STORAGE_ITEM_AVAILABLE}, |
| (...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2032 | 2035 |
| 2033 #if defined(OS_CHROMEOS) | 2036 #if defined(OS_CHROMEOS) |
| 2034 chromeos::network_element::AddLocalizedStrings(html_source); | 2037 chromeos::network_element::AddLocalizedStrings(html_source); |
| 2035 #endif | 2038 #endif |
| 2036 policy_indicator::AddLocalizedStrings(html_source); | 2039 policy_indicator::AddLocalizedStrings(html_source); |
| 2037 | 2040 |
| 2038 html_source->SetJsonPath(kLocalizedStringsFile); | 2041 html_source->SetJsonPath(kLocalizedStringsFile); |
| 2039 } | 2042 } |
| 2040 | 2043 |
| 2041 } // namespace settings | 2044 } // namespace settings |
| OLD | NEW |