OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "apps/app_window.h" | 10 #include "apps/app_window.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 { "hotwordConfirmMessage", IDS_HOTWORD_SEARCH_PREF_DESCRIPTION }, | 269 { "hotwordConfirmMessage", IDS_HOTWORD_SEARCH_PREF_DESCRIPTION }, |
270 { "hotwordAudioLoggingEnable", IDS_HOTWORD_AUDIO_LOGGING_ENABLE }, | 270 { "hotwordAudioLoggingEnable", IDS_HOTWORD_AUDIO_LOGGING_ENABLE }, |
271 { "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON }, | 271 { "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON }, |
272 { "improveBrowsingExperience", IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE }, | 272 { "improveBrowsingExperience", IDS_OPTIONS_IMPROVE_BROWSING_EXPERIENCE }, |
273 { "languageAndSpellCheckSettingsButton", | 273 { "languageAndSpellCheckSettingsButton", |
274 IDS_OPTIONS_SETTINGS_LANGUAGE_AND_INPUT_SETTINGS }, | 274 IDS_OPTIONS_SETTINGS_LANGUAGE_AND_INPUT_SETTINGS }, |
275 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF }, | 275 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF }, |
276 { "manageAutofillSettings", IDS_OPTIONS_MANAGE_AUTOFILL_SETTINGS_LINK }, | 276 { "manageAutofillSettings", IDS_OPTIONS_MANAGE_AUTOFILL_SETTINGS_LINK }, |
277 { "manageLanguages", IDS_OPTIONS_TRANSLATE_MANAGE_LANGUAGES }, | 277 { "manageLanguages", IDS_OPTIONS_TRANSLATE_MANAGE_LANGUAGES }, |
278 { "managePasswords", IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS_LINK }, | 278 { "managePasswords", IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS_LINK }, |
279 { "managedUserLabel", IDS_SUPERVISED_USER_AVATAR_LABEL }, | |
280 { "networkPredictionEnabledDescription", | 279 { "networkPredictionEnabledDescription", |
281 IDS_NETWORK_PREDICTION_ENABLED_DESCRIPTION }, | 280 IDS_NETWORK_PREDICTION_ENABLED_DESCRIPTION }, |
282 { "passwordsAndAutofillGroupName", | 281 { "passwordsAndAutofillGroupName", |
283 IDS_OPTIONS_PASSWORDS_AND_FORMS_GROUP_NAME }, | 282 IDS_OPTIONS_PASSWORDS_AND_FORMS_GROUP_NAME }, |
284 { "passwordManagerEnabled", IDS_OPTIONS_PASSWORD_MANAGER_ENABLE }, | 283 { "passwordManagerEnabled", IDS_OPTIONS_PASSWORD_MANAGER_ENABLE }, |
285 { "privacyClearDataButton", IDS_OPTIONS_PRIVACY_CLEAR_DATA_BUTTON }, | 284 { "privacyClearDataButton", IDS_OPTIONS_PRIVACY_CLEAR_DATA_BUTTON }, |
286 { "privacyContentSettingsButton", | 285 { "privacyContentSettingsButton", |
287 IDS_OPTIONS_PRIVACY_CONTENT_SETTINGS_BUTTON }, | 286 IDS_OPTIONS_PRIVACY_CONTENT_SETTINGS_BUTTON }, |
288 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, | 287 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, |
289 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, | 288 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, |
(...skipping 18 matching lines...) Expand all Loading... |
308 { "safeBrowsingEnableExtendedReporting", | 307 { "safeBrowsingEnableExtendedReporting", |
309 IDS_OPTIONS_SAFEBROWSING_ENABLE_EXTENDED_REPORTING }, | 308 IDS_OPTIONS_SAFEBROWSING_ENABLE_EXTENDED_REPORTING }, |
310 { "sectionTitleAppearance", IDS_APPEARANCE_GROUP_NAME }, | 309 { "sectionTitleAppearance", IDS_APPEARANCE_GROUP_NAME }, |
311 { "sectionTitleDefaultBrowser", IDS_OPTIONS_DEFAULTBROWSER_GROUP_NAME }, | 310 { "sectionTitleDefaultBrowser", IDS_OPTIONS_DEFAULTBROWSER_GROUP_NAME }, |
312 { "sectionTitleUsers", IDS_PROFILES_OPTIONS_GROUP_NAME }, | 311 { "sectionTitleUsers", IDS_PROFILES_OPTIONS_GROUP_NAME }, |
313 { "sectionTitleProxy", IDS_OPTIONS_PROXY_GROUP_NAME }, | 312 { "sectionTitleProxy", IDS_OPTIONS_PROXY_GROUP_NAME }, |
314 { "sectionTitleSearch", IDS_OPTIONS_DEFAULTSEARCH_GROUP_NAME }, | 313 { "sectionTitleSearch", IDS_OPTIONS_DEFAULTSEARCH_GROUP_NAME }, |
315 { "sectionTitleStartup", IDS_OPTIONS_STARTUP_GROUP_NAME }, | 314 { "sectionTitleStartup", IDS_OPTIONS_STARTUP_GROUP_NAME }, |
316 { "sectionTitleSync", IDS_SYNC_OPTIONS_GROUP_NAME }, | 315 { "sectionTitleSync", IDS_SYNC_OPTIONS_GROUP_NAME }, |
317 { "sectionTitleVoice", IDS_OPTIONS_VOICE_GROUP_NAME }, | 316 { "sectionTitleVoice", IDS_OPTIONS_VOICE_GROUP_NAME }, |
| 317 { "settingsTitle", IDS_SETTINGS_TITLE }, |
| 318 { "showAdvancedSettings", IDS_SETTINGS_SHOW_ADVANCED_SETTINGS }, |
318 { "spellingConfirmMessage", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT }, | 319 { "spellingConfirmMessage", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_TEXT }, |
319 { "spellingConfirmEnable", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE }, | 320 { "spellingConfirmEnable", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_ENABLE }, |
320 { "spellingConfirmDisable", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_DISABLE }, | 321 { "spellingConfirmDisable", IDS_CONTENT_CONTEXT_SPELLING_BUBBLE_DISABLE }, |
321 { "spellingPref", IDS_OPTIONS_SPELLING_PREF }, | 322 { "spellingPref", IDS_OPTIONS_SPELLING_PREF }, |
322 { "startupRestoreLastSession", IDS_OPTIONS_STARTUP_RESTORE_LAST_SESSION }, | 323 { "startupRestoreLastSession", IDS_OPTIONS_STARTUP_RESTORE_LAST_SESSION }, |
323 { "settingsTitle", IDS_SETTINGS_TITLE }, | |
324 { "showAdvancedSettings", IDS_SETTINGS_SHOW_ADVANCED_SETTINGS }, | |
325 { "startupSetPages", IDS_OPTIONS_STARTUP_SET_PAGES }, | 324 { "startupSetPages", IDS_OPTIONS_STARTUP_SET_PAGES }, |
326 { "startupShowNewTab", IDS_OPTIONS_STARTUP_SHOW_NEWTAB }, | 325 { "startupShowNewTab", IDS_OPTIONS_STARTUP_SHOW_NEWTAB }, |
327 { "startupShowPages", IDS_OPTIONS_STARTUP_SHOW_PAGES }, | 326 { "startupShowPages", IDS_OPTIONS_STARTUP_SHOW_PAGES }, |
328 { "suggestPref", IDS_OPTIONS_SUGGEST_PREF }, | 327 { "suggestPref", IDS_OPTIONS_SUGGEST_PREF }, |
| 328 { "supervisedUserLabel", IDS_SUPERVISED_USER_AVATAR_LABEL }, |
329 { "syncButtonTextInProgress", IDS_SYNC_NTP_SETUP_IN_PROGRESS }, | 329 { "syncButtonTextInProgress", IDS_SYNC_NTP_SETUP_IN_PROGRESS }, |
330 { "syncButtonTextStop", IDS_SYNC_STOP_SYNCING_BUTTON_LABEL }, | 330 { "syncButtonTextStop", IDS_SYNC_STOP_SYNCING_BUTTON_LABEL }, |
331 { "themesGallery", IDS_THEMES_GALLERY_BUTTON }, | 331 { "themesGallery", IDS_THEMES_GALLERY_BUTTON }, |
332 { "themesGalleryURL", IDS_THEMES_GALLERY_URL }, | 332 { "themesGalleryURL", IDS_THEMES_GALLERY_URL }, |
333 { "tabsToLinksPref", IDS_OPTIONS_TABS_TO_LINKS_PREF }, | 333 { "tabsToLinksPref", IDS_OPTIONS_TABS_TO_LINKS_PREF }, |
334 { "toolbarShowBookmarksBar", IDS_OPTIONS_TOOLBAR_SHOW_BOOKMARKS_BAR }, | 334 { "toolbarShowBookmarksBar", IDS_OPTIONS_TOOLBAR_SHOW_BOOKMARKS_BAR }, |
335 { "toolbarShowHomeButton", IDS_OPTIONS_TOOLBAR_SHOW_HOME_BUTTON }, | 335 { "toolbarShowHomeButton", IDS_OPTIONS_TOOLBAR_SHOW_HOME_BUTTON }, |
336 { "translateEnableTranslate", | 336 { "translateEnableTranslate", |
337 IDS_OPTIONS_TRANSLATE_ENABLE_TRANSLATE }, | 337 IDS_OPTIONS_TRANSLATE_ENABLE_TRANSLATE }, |
338 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 338 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 #if defined(OS_MACOSX) | 566 #if defined(OS_MACOSX) |
567 values->SetString("macPasswordsWarning", | 567 values->SetString("macPasswordsWarning", |
568 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING)); | 568 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MAC_WARNING)); |
569 values->SetBoolean("multiple_profiles", | 569 values->SetBoolean("multiple_profiles", |
570 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); | 570 g_browser_process->profile_manager()->GetNumberOfProfiles() > 1); |
571 #endif | 571 #endif |
572 | 572 |
573 if (ShouldShowMultiProfilesUserList()) | 573 if (ShouldShowMultiProfilesUserList()) |
574 values->Set("profilesInfo", GetProfilesInfoList().release()); | 574 values->Set("profilesInfo", GetProfilesInfoList().release()); |
575 | 575 |
576 values->SetBoolean("profileIsManaged", | 576 values->SetBoolean("profileIsSupervised", |
577 Profile::FromWebUI(web_ui())->IsSupervised()); | 577 Profile::FromWebUI(web_ui())->IsSupervised()); |
578 | 578 |
579 #if !defined(OS_CHROMEOS) | 579 #if !defined(OS_CHROMEOS) |
580 values->SetBoolean( | 580 values->SetBoolean( |
581 "gpuEnabledAtStart", | 581 "gpuEnabledAtStart", |
582 g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref()); | 582 g_browser_process->gpu_mode_manager()->initial_gpu_mode_pref()); |
583 #endif | 583 #endif |
584 | 584 |
585 #if defined(ENABLE_SERVICE_DISCOVERY) | 585 #if defined(ENABLE_SERVICE_DISCOVERY) |
586 values->SetBoolean("cloudPrintHideNotificationsCheckbox", | 586 values->SetBoolean("cloudPrintHideNotificationsCheckbox", |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 base::FilePath current_profile_path = | 1224 base::FilePath current_profile_path = |
1225 web_ui()->GetWebContents()->GetBrowserContext()->GetPath(); | 1225 web_ui()->GetWebContents()->GetBrowserContext()->GetPath(); |
1226 | 1226 |
1227 for (size_t i = 0, e = cache.GetNumberOfProfiles(); i < e; ++i) { | 1227 for (size_t i = 0, e = cache.GetNumberOfProfiles(); i < e; ++i) { |
1228 base::DictionaryValue* profile_value = new base::DictionaryValue(); | 1228 base::DictionaryValue* profile_value = new base::DictionaryValue(); |
1229 profile_value->SetString("name", cache.GetNameOfProfileAtIndex(i)); | 1229 profile_value->SetString("name", cache.GetNameOfProfileAtIndex(i)); |
1230 base::FilePath profile_path = cache.GetPathOfProfileAtIndex(i); | 1230 base::FilePath profile_path = cache.GetPathOfProfileAtIndex(i); |
1231 profile_value->Set("filePath", base::CreateFilePathValue(profile_path)); | 1231 profile_value->Set("filePath", base::CreateFilePathValue(profile_path)); |
1232 profile_value->SetBoolean("isCurrentProfile", | 1232 profile_value->SetBoolean("isCurrentProfile", |
1233 profile_path == current_profile_path); | 1233 profile_path == current_profile_path); |
1234 profile_value->SetBoolean("isManaged", cache.ProfileIsSupervisedAtIndex(i)); | 1234 profile_value->SetBoolean("isSupervised", |
| 1235 cache.ProfileIsSupervisedAtIndex(i)); |
1235 | 1236 |
1236 bool is_gaia_picture = | 1237 bool is_gaia_picture = |
1237 cache.IsUsingGAIAPictureOfProfileAtIndex(i) && | 1238 cache.IsUsingGAIAPictureOfProfileAtIndex(i) && |
1238 cache.GetGAIAPictureOfProfileAtIndex(i); | 1239 cache.GetGAIAPictureOfProfileAtIndex(i); |
1239 if (is_gaia_picture) { | 1240 if (is_gaia_picture) { |
1240 gfx::Image icon = profiles::GetAvatarIconForWebUI( | 1241 gfx::Image icon = profiles::GetAvatarIconForWebUI( |
1241 cache.GetAvatarIconOfProfileAtIndex(i), true); | 1242 cache.GetAvatarIconOfProfileAtIndex(i), true); |
1242 profile_value->SetString("iconURL", | 1243 profile_value->SetString("iconURL", |
1243 webui::GetBitmapDataUrl(icon.AsBitmap())); | 1244 webui::GetBitmapDataUrl(icon.AsBitmap())); |
1244 } else { | 1245 } else { |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 extension = extensions::GetExtensionOverridingProxy( | 1806 extension = extensions::GetExtensionOverridingProxy( |
1806 Profile::FromWebUI(web_ui())); | 1807 Profile::FromWebUI(web_ui())); |
1807 AppendExtensionData("proxy", extension, &extension_controlled); | 1808 AppendExtensionData("proxy", extension, &extension_controlled); |
1808 | 1809 |
1809 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", | 1810 web_ui()->CallJavascriptFunction("BrowserOptions.toggleExtensionIndicators", |
1810 extension_controlled); | 1811 extension_controlled); |
1811 #endif // defined(OS_WIN) | 1812 #endif // defined(OS_WIN) |
1812 } | 1813 } |
1813 | 1814 |
1814 } // namespace options | 1815 } // namespace options |
OLD | NEW |