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

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

Issue 2535303003: [CUPS] Fix the browser crash in CUPS settings UI in guest mode. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 1187
1188 html_source->AddString("syncErrorHelpUrl", chrome::kSyncErrorsHelpURL); 1188 html_source->AddString("syncErrorHelpUrl", chrome::kSyncErrorsHelpURL);
1189 1189
1190 html_source->AddString("activityControlsUrl", 1190 html_source->AddString("activityControlsUrl",
1191 chrome::kGoogleAccountActivityControlsURL); 1191 chrome::kGoogleAccountActivityControlsURL);
1192 1192
1193 html_source->AddBoolean("profileShortcutsEnabled", 1193 html_source->AddBoolean("profileShortcutsEnabled",
1194 ProfileShortcutManager::IsFeatureEnabled()); 1194 ProfileShortcutManager::IsFeatureEnabled());
1195 } 1195 }
1196 1196
1197 void AddPrintingStrings(content::WebUIDataSource* html_source) { 1197 void AddPrintingStrings(content::WebUIDataSource* html_source,
1198 Profile* profile) {
1198 LocalizedString localized_strings[] = { 1199 LocalizedString localized_strings[] = {
1199 {"printingPageTitle", IDS_SETTINGS_PRINTING}, 1200 {"printingPageTitle", IDS_SETTINGS_PRINTING},
1200 {"printingCloudPrintLearnMoreLabel", 1201 {"printingCloudPrintLearnMoreLabel",
1201 IDS_SETTINGS_PRINTING_CLOUD_PRINT_LEARN_MORE_LABEL}, 1202 IDS_SETTINGS_PRINTING_CLOUD_PRINT_LEARN_MORE_LABEL},
1202 {"printingNotificationsLabel", IDS_SETTINGS_PRINTING_NOTIFICATIONS_LABEL}, 1203 {"printingNotificationsLabel", IDS_SETTINGS_PRINTING_NOTIFICATIONS_LABEL},
1203 {"printingManageCloudPrintDevices", 1204 {"printingManageCloudPrintDevices",
1204 IDS_SETTINGS_PRINTING_MANAGE_CLOUD_PRINT_DEVICES}, 1205 IDS_SETTINGS_PRINTING_MANAGE_CLOUD_PRINT_DEVICES},
1205 {"printingManageCloudPrintDevicesDescription", 1206 {"printingManageCloudPrintDevicesDescription",
1206 IDS_SETTINGS_PRINTING_MANAGE_CLOUD_PRINT_DEVICES_DESCRIPTION}, 1207 IDS_SETTINGS_PRINTING_MANAGE_CLOUD_PRINT_DEVICES_DESCRIPTION},
1207 {"cloudPrintersTitle", IDS_SETTINGS_PRINTING_CLOUD_PRINTERS}, 1208 {"cloudPrintersTitle", IDS_SETTINGS_PRINTING_CLOUD_PRINTERS},
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 AddLocalizedStringsBulk(html_source, localized_strings, 1269 AddLocalizedStringsBulk(html_source, localized_strings,
1269 arraysize(localized_strings)); 1270 arraysize(localized_strings));
1270 1271
1271 html_source->AddString("devicesUrl", chrome::kChromeUIDevicesURL); 1272 html_source->AddString("devicesUrl", chrome::kChromeUIDevicesURL);
1272 html_source->AddString("printingCloudPrintLearnMoreUrl", 1273 html_source->AddString("printingCloudPrintLearnMoreUrl",
1273 chrome::kCloudPrintLearnMoreURL); 1274 chrome::kCloudPrintLearnMoreURL);
1274 1275
1275 #if defined(OS_CHROMEOS) 1276 #if defined(OS_CHROMEOS)
1276 html_source->AddBoolean("showCupsPrintingFeatures", 1277 html_source->AddBoolean("showCupsPrintingFeatures",
1277 base::CommandLine::ForCurrentProcess()->HasSwitch( 1278 base::CommandLine::ForCurrentProcess()->HasSwitch(
1278 ::switches::kEnableNativeCups)); 1279 ::switches::kEnableNativeCups) &&
1280 !profile->IsOffTheRecord());
1279 #endif 1281 #endif
1280 } 1282 }
1281 1283
1282 void AddPrivacyStrings(content::WebUIDataSource* html_source, 1284 void AddPrivacyStrings(content::WebUIDataSource* html_source,
1283 Profile* profile) { 1285 Profile* profile) {
1284 LocalizedString localized_strings[] = { 1286 LocalizedString localized_strings[] = {
1285 {"privacyPageTitle", IDS_SETTINGS_PRIVACY}, 1287 {"privacyPageTitle", IDS_SETTINGS_PRIVACY},
1286 {"linkDoctorPref", IDS_SETTINGS_LINKDOCTOR_PREF}, 1288 {"linkDoctorPref", IDS_SETTINGS_LINKDOCTOR_PREF},
1287 {"searchSuggestPref", IDS_SETTINGS_SUGGEST_PREF}, 1289 {"searchSuggestPref", IDS_SETTINGS_SUGGEST_PREF},
1288 {"networkPredictionEnabled", 1290 {"networkPredictionEnabled",
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 AddA11yStrings(html_source); 1782 AddA11yStrings(html_source);
1781 AddAboutStrings(html_source); 1783 AddAboutStrings(html_source);
1782 AddAppearanceStrings(html_source, profile); 1784 AddAppearanceStrings(html_source, profile);
1783 AddClearBrowsingDataStrings(html_source); 1785 AddClearBrowsingDataStrings(html_source);
1784 AddCommonStrings(html_source, profile); 1786 AddCommonStrings(html_source, profile);
1785 AddDownloadsStrings(html_source); 1787 AddDownloadsStrings(html_source);
1786 AddLanguagesStrings(html_source); 1788 AddLanguagesStrings(html_source);
1787 AddOnStartupStrings(html_source); 1789 AddOnStartupStrings(html_source);
1788 AddPasswordsAndFormsStrings(html_source); 1790 AddPasswordsAndFormsStrings(html_source);
1789 AddPeopleStrings(html_source); 1791 AddPeopleStrings(html_source);
1790 AddPrintingStrings(html_source); 1792 AddPrintingStrings(html_source, profile);
1791 AddPrivacyStrings(html_source, profile); 1793 AddPrivacyStrings(html_source, profile);
1792 AddResetStrings(html_source); 1794 AddResetStrings(html_source);
1793 AddSearchEnginesStrings(html_source); 1795 AddSearchEnginesStrings(html_source);
1794 AddSearchInSettingsStrings(html_source); 1796 AddSearchInSettingsStrings(html_source);
1795 AddSearchStrings(html_source); 1797 AddSearchStrings(html_source);
1796 AddSiteSettingsStrings(html_source, profile); 1798 AddSiteSettingsStrings(html_source, profile);
1797 AddUsersStrings(html_source); 1799 AddUsersStrings(html_source);
1798 AddWebContentStrings(html_source); 1800 AddWebContentStrings(html_source);
1799 1801
1800 #if defined(OS_CHROMEOS) 1802 #if defined(OS_CHROMEOS)
(...skipping 14 matching lines...) Expand all
1815 #if defined(USE_NSS_CERTS) 1817 #if defined(USE_NSS_CERTS)
1816 AddCertificateManagerStrings(html_source); 1818 AddCertificateManagerStrings(html_source);
1817 #endif 1819 #endif
1818 1820
1819 policy_indicator::AddLocalizedStrings(html_source); 1821 policy_indicator::AddLocalizedStrings(html_source);
1820 1822
1821 html_source->SetJsonPath(kLocalizedStringsFile); 1823 html_source->SetJsonPath(kLocalizedStringsFile);
1822 } 1824 }
1823 1825
1824 } // namespace settings 1826 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698