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

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

Issue 2106103006: MD Settings: cr/cros - Guest mode page visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after overscrollHeight_() fix Created 4 years, 4 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 void AddLocalizedStringsBulk(content::WebUIDataSource* html_source, 54 void AddLocalizedStringsBulk(content::WebUIDataSource* html_source,
55 LocalizedString localized_strings[], 55 LocalizedString localized_strings[],
56 size_t num_strings) { 56 size_t num_strings) {
57 for (size_t i = 0; i < num_strings; i++) { 57 for (size_t i = 0; i < num_strings; i++) {
58 html_source->AddLocalizedString(localized_strings[i].name, 58 html_source->AddLocalizedString(localized_strings[i].name,
59 localized_strings[i].id); 59 localized_strings[i].id);
60 } 60 }
61 } 61 }
62 62
63 void AddCommonStrings(content::WebUIDataSource* html_source) { 63 void AddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) {
64 LocalizedString localized_strings[] = { 64 LocalizedString localized_strings[] = {
65 {"add", IDS_ADD}, 65 {"add", IDS_ADD},
66 {"cancel", IDS_CANCEL}, 66 {"cancel", IDS_CANCEL},
67 {"disable", IDS_DISABLE}, 67 {"disable", IDS_DISABLE},
68 {"learnMore", IDS_LEARN_MORE}, 68 {"learnMore", IDS_LEARN_MORE},
69 {"ok", IDS_OK}, 69 {"ok", IDS_OK},
70 {"save", IDS_SAVE}, 70 {"save", IDS_SAVE},
71 {"advancedPageTitle", IDS_SETTINGS_ADVANCED}, 71 {"advancedPageTitle", IDS_SETTINGS_ADVANCED},
72 {"basicPageTitle", IDS_SETTINGS_BASIC}, 72 {"basicPageTitle", IDS_SETTINGS_BASIC},
73 {"settings", IDS_SETTINGS_SETTINGS}, 73 {"settings", IDS_SETTINGS_SETTINGS},
74 {"restart", IDS_SETTINGS_RESTART}, 74 {"restart", IDS_SETTINGS_RESTART},
75 }; 75 };
76 AddLocalizedStringsBulk(html_source, localized_strings, 76 AddLocalizedStringsBulk(html_source, localized_strings,
77 arraysize(localized_strings)); 77 arraysize(localized_strings));
78
79 html_source->AddBoolean(
80 "isGuest",
81 #if defined(OS_CHROMEOS)
82 user_manager::UserManager::Get()->IsLoggedInAsGuest());
83 #else
84 profile->IsOffTheRecord());
85 #endif
78 } 86 }
79 87
80 void AddA11yStrings(content::WebUIDataSource* html_source) { 88 void AddA11yStrings(content::WebUIDataSource* html_source) {
81 LocalizedString localized_strings[] = { 89 LocalizedString localized_strings[] = {
82 {"a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY}, 90 {"a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY},
83 {"moreFeaturesLink", IDS_SETTINGS_MORE_FEATURES_LINK}, 91 {"moreFeaturesLink", IDS_SETTINGS_MORE_FEATURES_LINK},
84 #if defined(OS_CHROMEOS) 92 #if defined(OS_CHROMEOS)
85 {"optionsInMenuLabel", IDS_SETTINGS_OPTIONS_IN_MENU_LABEL}, 93 {"optionsInMenuLabel", IDS_SETTINGS_OPTIONS_IN_MENU_LABEL},
86 {"largeMouseCursorLabel", IDS_SETTINGS_LARGE_MOUSE_CURSOR_LABEL}, 94 {"largeMouseCursorLabel", IDS_SETTINGS_LARGE_MOUSE_CURSOR_LABEL},
87 {"highContrastLabel", IDS_SETTINGS_HIGH_CONTRAST_LABEL}, 95 {"highContrastLabel", IDS_SETTINGS_HIGH_CONTRAST_LABEL},
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 {"quickBrownFox", IDS_SETTINGS_QUICK_BROWN_FOX}, 1308 {"quickBrownFox", IDS_SETTINGS_QUICK_BROWN_FOX},
1301 }; 1309 };
1302 AddLocalizedStringsBulk(html_source, localized_strings, 1310 AddLocalizedStringsBulk(html_source, localized_strings,
1303 arraysize(localized_strings)); 1311 arraysize(localized_strings));
1304 } 1312 }
1305 1313
1306 } // namespace 1314 } // namespace
1307 1315
1308 void AddLocalizedStrings(content::WebUIDataSource* html_source, 1316 void AddLocalizedStrings(content::WebUIDataSource* html_source,
1309 Profile* profile) { 1317 Profile* profile) {
1310 AddCommonStrings(html_source); 1318 AddCommonStrings(html_source, profile);
1311 1319
1312 AddA11yStrings(html_source); 1320 AddA11yStrings(html_source);
1313 AddAboutStrings(html_source); 1321 AddAboutStrings(html_source);
1314 #if defined(OS_CHROMEOS) 1322 #if defined(OS_CHROMEOS)
1315 AddAccountUITweaksStrings(html_source, profile); 1323 AddAccountUITweaksStrings(html_source, profile);
1316 #endif 1324 #endif
1317 AddAppearanceStrings(html_source); 1325 AddAppearanceStrings(html_source);
1318 #if defined(OS_CHROMEOS) 1326 #if defined(OS_CHROMEOS)
1319 AddBluetoothStrings(html_source); 1327 AddBluetoothStrings(html_source);
1320 #endif 1328 #endif
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 #endif 1362 #endif
1355 AddUsersStrings(html_source); 1363 AddUsersStrings(html_source);
1356 AddWebContentStrings(html_source); 1364 AddWebContentStrings(html_source);
1357 1365
1358 policy_indicator::AddLocalizedStrings(html_source); 1366 policy_indicator::AddLocalizedStrings(html_source);
1359 1367
1360 html_source->SetJsonPath(kLocalizedStringsFile); 1368 html_source->SetJsonPath(kLocalizedStringsFile);
1361 } 1369 }
1362 1370
1363 } // namespace settings 1371 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698