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

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: Fix closure and tests 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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 {"stylusNoteTakingAppWaitingForAndroid", 636 {"stylusNoteTakingAppWaitingForAndroid",
636 IDS_SETTINGS_STYLUS_NOTE_TAKING_APP_WAITING_FOR_ANDROID}}; 637 IDS_SETTINGS_STYLUS_NOTE_TAKING_APP_WAITING_FOR_ANDROID}};
637 AddLocalizedStringsBulk(html_source, stylus_strings, 638 AddLocalizedStringsBulk(html_source, stylus_strings,
638 arraysize(stylus_strings)); 639 arraysize(stylus_strings));
639 640
640 LocalizedString display_strings[] = { 641 LocalizedString display_strings[] = {
641 {"displayTitle", IDS_SETTINGS_DISPLAY_TITLE}, 642 {"displayTitle", IDS_SETTINGS_DISPLAY_TITLE},
642 {"displayArrangementText", IDS_SETTINGS_DISPLAY_ARRANGEMENT_TEXT}, 643 {"displayArrangementText", IDS_SETTINGS_DISPLAY_ARRANGEMENT_TEXT},
643 {"displayArrangementTitle", IDS_SETTINGS_DISPLAY_ARRANGEMENT_TITLE}, 644 {"displayArrangementTitle", IDS_SETTINGS_DISPLAY_ARRANGEMENT_TITLE},
644 {"displayMirror", IDS_SETTINGS_DISPLAY_MIRROR}, 645 {"displayMirror", IDS_SETTINGS_DISPLAY_MIRROR},
645 {"displayMirrorOff", IDS_SETTINGS_DISPLAY_MIRRORING_OFF}, 646 {"displayUnfiedDesktop", IDS_SETTINGS_DISPLAY_UNIFIED_DESKTOP},
646 {"displayMirrorOn", IDS_SETTINGS_DISPLAY_MIRRORING_ON},
647 {"displayResolutionTitle", IDS_SETTINGS_DISPLAY_RESOLUTION_TITLE}, 647 {"displayResolutionTitle", IDS_SETTINGS_DISPLAY_RESOLUTION_TITLE},
648 {"displayResolutionText", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT}, 648 {"displayResolutionText", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT},
649 {"displayResolutionTextBest", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_BEST}, 649 {"displayResolutionTextBest", IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_BEST},
650 {"displayResolutionTextNative", 650 {"displayResolutionTextNative",
651 IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_NATIVE}, 651 IDS_SETTINGS_DISPLAY_RESOLUTION_TEXT_NATIVE},
652 {"displayScreenTitle", IDS_SETTINGS_DISPLAY_SCREEN}, 652 {"displayScreenTitle", IDS_SETTINGS_DISPLAY_SCREEN},
653 {"displayScreenExtended", IDS_SETTINGS_DISPLAY_SCREEN_EXTENDED}, 653 {"displayScreenExtended", IDS_SETTINGS_DISPLAY_SCREEN_EXTENDED},
654 {"displayScreenPrimary", IDS_SETTINGS_DISPLAY_SCREEN_PRIMARY}, 654 {"displayScreenPrimary", IDS_SETTINGS_DISPLAY_SCREEN_PRIMARY},
655 {"displayOrientation", IDS_SETTINGS_DISPLAY_ORIENTATION}, 655 {"displayOrientation", IDS_SETTINGS_DISPLAY_ORIENTATION},
656 {"displayOrientationStandard", IDS_SETTINGS_DISPLAY_ORIENTATION_STANDARD}, 656 {"displayOrientationStandard", IDS_SETTINGS_DISPLAY_ORIENTATION_STANDARD},
657 {"displayOverscanPageText", IDS_SETTINGS_DISPLAY_OVERSCAN_TEXT}, 657 {"displayOverscanPageText", IDS_SETTINGS_DISPLAY_OVERSCAN_TEXT},
658 {"displayOverscanPageTitle", IDS_SETTINGS_DISPLAY_OVERSCAN_TITLE}, 658 {"displayOverscanPageTitle", IDS_SETTINGS_DISPLAY_OVERSCAN_TITLE},
659 {"displayOverscanSubtitle", IDS_SETTINGS_DISPLAY_OVERSCAN_SUBTITLE}, 659 {"displayOverscanSubtitle", IDS_SETTINGS_DISPLAY_OVERSCAN_SUBTITLE},
660 {"displayOverscanInstructions", 660 {"displayOverscanInstructions",
661 IDS_SETTINGS_DISPLAY_OVERSCAN_INSTRUCTIONS}, 661 IDS_SETTINGS_DISPLAY_OVERSCAN_INSTRUCTIONS},
662 {"displayOverscanResize", IDS_SETTINGS_DISPLAY_OVERSCAN_RESIZE}, 662 {"displayOverscanResize", IDS_SETTINGS_DISPLAY_OVERSCAN_RESIZE},
663 {"displayOverscanPosition", IDS_SETTINGS_DISPLAY_OVERSCAN_POSITION}, 663 {"displayOverscanPosition", IDS_SETTINGS_DISPLAY_OVERSCAN_POSITION},
664 {"displayOverscanReset", IDS_SETTINGS_DISPLAY_OVERSCAN_RESET}, 664 {"displayOverscanReset", IDS_SETTINGS_DISPLAY_OVERSCAN_RESET},
665 {"displayTouchCalibrationTitle", 665 {"displayTouchCalibrationTitle",
666 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TITLE}, 666 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TITLE},
667 {"displayTouchCalibrationText", 667 {"displayTouchCalibrationText",
668 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TEXT} 668 IDS_SETTINGS_DISPLAY_TOUCH_CALIBRATION_TEXT}};
669 };
670 AddLocalizedStringsBulk(html_source, display_strings, 669 AddLocalizedStringsBulk(html_source, display_strings,
671 arraysize(display_strings)); 670 arraysize(display_strings));
671 html_source->AddBoolean("unifiedDesktopAvailable",
672 base::CommandLine::ForCurrentProcess()->HasSwitch(
673 ::switches::kEnableUnifiedDesktop));
672 674
673 html_source->AddBoolean( 675 html_source->AddBoolean(
674 "enableTouchCalibrationSetting", 676 "enableTouchCalibrationSetting",
675 base::CommandLine::ForCurrentProcess()->HasSwitch( 677 base::CommandLine::ForCurrentProcess()->HasSwitch(
676 chromeos::switches::kEnableTouchCalibrationSetting)); 678 chromeos::switches::kEnableTouchCalibrationSetting));
677 679
678 LocalizedString storage_strings[] = { 680 LocalizedString storage_strings[] = {
679 {"storageTitle", IDS_SETTINGS_STORAGE_TITLE}, 681 {"storageTitle", IDS_SETTINGS_STORAGE_TITLE},
680 {"storageItemInUse", IDS_SETTINGS_STORAGE_ITEM_IN_USE}, 682 {"storageItemInUse", IDS_SETTINGS_STORAGE_ITEM_IN_USE},
681 {"storageItemAvailable", IDS_SETTINGS_STORAGE_ITEM_AVAILABLE}, 683 {"storageItemAvailable", IDS_SETTINGS_STORAGE_ITEM_AVAILABLE},
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 2040
2039 #if defined(OS_CHROMEOS) 2041 #if defined(OS_CHROMEOS)
2040 chromeos::network_element::AddLocalizedStrings(html_source); 2042 chromeos::network_element::AddLocalizedStrings(html_source);
2041 #endif 2043 #endif
2042 policy_indicator::AddLocalizedStrings(html_source); 2044 policy_indicator::AddLocalizedStrings(html_source);
2043 2045
2044 html_source->SetJsonPath(kLocalizedStringsFile); 2046 html_source->SetJsonPath(kLocalizedStringsFile);
2045 } 2047 }
2046 2048
2047 } // namespace settings 2049 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/device_page/display.js ('k') | chrome/test/data/webui/settings/device_page_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698