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