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

Side by Side Diff: chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc

Issue 2802603005: MD Settings: Display: Add unified desktop control and modify api (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
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
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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 {"displayMirrorOff", IDS_SETTINGS_DISPLAY_MIRRORING_OFF},
638 {"displayMirrorOn", IDS_SETTINGS_DISPLAY_MIRRORING_ON}, 639 {"displayMirrorOn", IDS_SETTINGS_DISPLAY_MIRRORING_ON},
640 {"displayUnfiedDesktop", IDS_SETTINGS_DISPLAY_UNIFIED_DESKTOP},
639 {"displayResolutionTitle", IDS_SETTINGS_DISPLAY_RESOLUTION_TITLE}, 641 {"displayResolutionTitle", IDS_SETTINGS_DISPLAY_RESOLUTION_TITLE},
640 {"displayResolutionText", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT}, 642 {"displayResolutionText", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT},
641 {"displayResolutionTextBest", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_BEST}, 643 {"displayResolutionTextBest", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_BEST},
642 {"displayResolutionTextNative", 644 {"displayResolutionTextNative",
643 IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_NATIVE}, 645 IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_NATIVE},
644 {"displayScreenTitle", IDS_SETTINGS_DISPLAY_SCREEN}, 646 {"displayScreenTitle", IDS_SETTINGS_DISPLAY_SCREEN},
645 {"displayScreenExtended", IDS_SETTINGS_DISPLAY_SCREEN_EXTENDED}, 647 {"displayScreenExtended", IDS_SETTINGS_DISPLAY_SCREEN_EXTENDED},
646 {"displayScreenPrimary", IDS_SETTINGS_DISPLAY_SCREEN_PRIMARY}, 648 {"displayScreenPrimary", IDS_SETTINGS_DISPLAY_SCREEN_PRIMARY},
647 {"displayOrientation", IDS_SETTINGS_DISPLAY_ORIENTATION}, 649 {"displayOrientation", IDS_SETTINGS_DISPLAY_ORIENTATION},
648 {"displayOrientationStandard", IDS_SETTINGS_DISPLAY_ORIENTATION_STANDARD}, 650 {"displayOrientationStandard", IDS_SETTINGS_DISPLAY_ORIENTATION_STANDARD},
649 {"displayOverscanPageText", IDS_SETTINGS_DISPLAY_OVERSCAN_TEXT}, 651 {"displayOverscanPageText", IDS_SETTINGS_DISPLAY_OVERSCAN_TEXT},
650 {"displayOverscanPageTitle", IDS_SETTINGS_DISPLAY_OVERSCAN_TITLE}, 652 {"displayOverscanPageTitle", IDS_SETTINGS_DISPLAY_OVERSCAN_TITLE},
651 {"displayOverscanSubtitle", IDS_SETTINGS_DISPLAY_OVERSCAN_SUBTITLE}, 653 {"displayOverscanSubtitle", IDS_SETTINGS_DISPLAY_OVERSCAN_SUBTITLE},
652 {"displayOverscanInstructions", 654 {"displayOverscanInstructions",
653 IDS_SETTINGS_DISPLAY_OVERSCAN_INSTRUCTIONS}, 655 IDS_SETTINGS_DISPLAY_OVERSCAN_INSTRUCTIONS},
654 {"displayOverscanResize", IDS_SETTINGS_DISPLAY_OVERSCAN_RESIZE}, 656 {"displayOverscanResize", IDS_SETTINGS_DISPLAY_OVERSCAN_RESIZE},
655 {"displayOverscanPosition", IDS_SETTINGS_DISPLAY_OVERSCAN_POSITION}, 657 {"displayOverscanPosition", IDS_SETTINGS_DISPLAY_OVERSCAN_POSITION},
656 {"displayOverscanReset", IDS_SETTINGS_DISPLAY_OVERSCAN_RESET}, 658 {"displayOverscanReset", IDS_SETTINGS_DISPLAY_OVERSCAN_RESET},
657 {"displayTouchCalibrationTitle", 659 {"displayTouchCalibrationTitle",
658 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TITLE}, 660 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TITLE},
659 {"displayTouchCalibrationText", 661 {"displayTouchCalibrationText",
660 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TEXT} 662 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TEXT}
661 }; 663 };
662 AddLocalizedStringsBulk(html_source, display_strings, 664 AddLocalizedStringsBulk(html_source, display_strings,
663 arraysize(display_strings)); 665 arraysize(display_strings));
666 html_source->AddBoolean("unifiedDesktopAvailable",
667 base::CommandLine::ForCurrentProcess()->HasSwitch(
668 ::switches::kEnableUnifiedDesktop));
664 669
665 html_source->AddBoolean( 670 html_source->AddBoolean(
666 "enableTouchCalibrationSetting", 671 "enableTouchCalibrationSetting",
667 base::CommandLine::ForCurrentProcess()->HasSwitch( 672 base::CommandLine::ForCurrentProcess()->HasSwitch(
668 chromeos::switches::kEnableTouchCalibrationSetting)); 673 chromeos::switches::kEnableTouchCalibrationSetting));
669 674
670 LocalizedString storage_strings[] = { 675 LocalizedString storage_strings[] = {
671 {"storageTitle", IDS_SETTINGS_STORAGE_TITLE}, 676 {"storageTitle", IDS_SETTINGS_STORAGE_TITLE},
672 {"storageItemInUse", IDS_SETTINGS_STORAGE_ITEM_IN_USE}, 677 {"storageItemInUse", IDS_SETTINGS_STORAGE_ITEM_IN_USE},
673 {"storageItemAvailable", IDS_SETTINGS_STORAGE_ITEM_AVAILABLE}, 678 {"storageItemAvailable", IDS_SETTINGS_STORAGE_ITEM_AVAILABLE},
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after
2032 2037
2033 #if defined(OS_CHROMEOS) 2038 #if defined(OS_CHROMEOS)
2034 chromeos::network_element::AddLocalizedStrings(html_source); 2039 chromeos::network_element::AddLocalizedStrings(html_source);
2035 #endif 2040 #endif
2036 policy_indicator::AddLocalizedStrings(html_source); 2041 policy_indicator::AddLocalizedStrings(html_source);
2037 2042
2038 html_source->SetJsonPath(kLocalizedStringsFile); 2043 html_source->SetJsonPath(kLocalizedStringsFile);
2039 } 2044 }
2040 2045
2041 } // namespace settings 2046 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698