Chromium Code Reviews| 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/options2/browser_options_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/browser_options_handler2.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 IDS_OPTIONS_LANGUAGE_AND_SPELLCHECK_BUTTON }, | 204 IDS_OPTIONS_LANGUAGE_AND_SPELLCHECK_BUTTON }, |
| 205 #endif | 205 #endif |
| 206 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF }, | 206 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF }, |
| 207 { "manageAutofillSettings", IDS_OPTIONS_MANAGE_AUTOFILL_SETTINGS_LINK }, | 207 { "manageAutofillSettings", IDS_OPTIONS_MANAGE_AUTOFILL_SETTINGS_LINK }, |
| 208 { "managePasswords", IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS_LINK }, | 208 { "managePasswords", IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS_LINK }, |
| 209 { "networkPredictionEnabledDescription", | 209 { "networkPredictionEnabledDescription", |
| 210 IDS_NETWORK_PREDICTION_ENABLED_DESCRIPTION }, | 210 IDS_NETWORK_PREDICTION_ENABLED_DESCRIPTION }, |
| 211 { "passwordsAndAutofillGroupName", | 211 { "passwordsAndAutofillGroupName", |
| 212 IDS_OPTIONS_PASSWORDS_AND_FORMS_GROUP_NAME }, | 212 IDS_OPTIONS_PASSWORDS_AND_FORMS_GROUP_NAME }, |
| 213 { "passwordManagerEnabled", IDS_OPTIONS_PASSWORD_MANAGER_ENABLE }, | 213 { "passwordManagerEnabled", IDS_OPTIONS_PASSWORD_MANAGER_ENABLE }, |
| 214 { "passwordGenerationEnabledDescription", | |
| 215 IDS_OPTIONS_PASSWORD_GENERATION_ENABLED_LABEL }, | |
| 214 { "privacyClearDataButton", IDS_OPTIONS_PRIVACY_CLEAR_DATA_BUTTON }, | 216 { "privacyClearDataButton", IDS_OPTIONS_PRIVACY_CLEAR_DATA_BUTTON }, |
| 215 { "privacyContentSettingsButton", | 217 { "privacyContentSettingsButton", |
| 216 IDS_OPTIONS_PRIVACY_CONTENT_SETTINGS_BUTTON }, | 218 IDS_OPTIONS_PRIVACY_CONTENT_SETTINGS_BUTTON }, |
| 217 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, | 219 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, |
| 218 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, | 220 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, |
| 219 { "profilesDeleteSingle", IDS_PROFILES_DELETE_SINGLE_BUTTON_LABEL }, | 221 { "profilesDeleteSingle", IDS_PROFILES_DELETE_SINGLE_BUTTON_LABEL }, |
| 220 { "profilesListItemCurrent", IDS_PROFILES_LIST_ITEM_CURRENT }, | 222 { "profilesListItemCurrent", IDS_PROFILES_LIST_ITEM_CURRENT }, |
| 221 { "profilesManage", IDS_PROFILES_MANAGE_BUTTON_LABEL }, | 223 { "profilesManage", IDS_PROFILES_MANAGE_BUTTON_LABEL }, |
| 222 { "proxiesLabel", IDS_OPTIONS_PROXIES_LABEL }, | 224 { "proxiesLabel", IDS_OPTIONS_PROXIES_LABEL }, |
| 223 { "safeBrowsingEnableProtection", | 225 { "safeBrowsingEnableProtection", |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 608 PrefSetObserver::CreateProxyPrefSetObserver(prefs, this)); | 610 PrefSetObserver::CreateProxyPrefSetObserver(prefs, this)); |
| 609 #endif // !defined(OS_CHROMEOS) | 611 #endif // !defined(OS_CHROMEOS) |
| 610 } | 612 } |
| 611 | 613 |
| 612 void BrowserOptionsHandler::InitializePage() { | 614 void BrowserOptionsHandler::InitializePage() { |
| 613 OnTemplateURLServiceChanged(); | 615 OnTemplateURLServiceChanged(); |
| 614 ObserveThemeChanged(); | 616 ObserveThemeChanged(); |
| 615 | 617 |
| 616 SetupMetricsReportingCheckbox(); | 618 SetupMetricsReportingCheckbox(); |
| 617 SetupMetricsReportingSettingVisibility(); | 619 SetupMetricsReportingSettingVisibility(); |
| 620 SetupPasswordGenerationSettingVisibility(); | |
| 618 SetupFontSizeSelector(); | 621 SetupFontSizeSelector(); |
| 619 SetupPageZoomSelector(); | 622 SetupPageZoomSelector(); |
| 620 SetupAutoOpenFileTypes(); | 623 SetupAutoOpenFileTypes(); |
| 621 SetupProxySettingsSection(); | 624 SetupProxySettingsSection(); |
| 622 SetupSSLConfigSettings(); | 625 SetupSSLConfigSettings(); |
| 623 #if !defined(OS_CHROMEOS) | 626 #if !defined(OS_CHROMEOS) |
| 624 if (cloud_print_connector_ui_enabled_) { | 627 if (cloud_print_connector_ui_enabled_) { |
| 625 SetupCloudPrintConnectorSection(); | 628 SetupCloudPrintConnectorSection(); |
| 626 RefreshCloudPrintStatusFromService(); | 629 RefreshCloudPrintStatusFromService(); |
| 627 } else { | 630 } else { |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1323 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) | 1326 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) |
| 1324 // Don't show the reporting setting if we are in the guest mode. | 1327 // Don't show the reporting setting if we are in the guest mode. |
| 1325 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { | 1328 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { |
| 1326 base::FundamentalValue visible(false); | 1329 base::FundamentalValue visible(false); |
| 1327 web_ui()->CallJavascriptFunction( | 1330 web_ui()->CallJavascriptFunction( |
| 1328 "BrowserOptions.setMetricsReportingSettingVisibility", visible); | 1331 "BrowserOptions.setMetricsReportingSettingVisibility", visible); |
| 1329 } | 1332 } |
| 1330 #endif | 1333 #endif |
| 1331 } | 1334 } |
| 1332 | 1335 |
| 1336 void BrowserOptionsHandler::SetupPasswordGenerationSettingVisibility() { | |
| 1337 base::FundamentalValue visible( | |
| 1338 CommandLine::ForCurrentProcess()->HasSwitch( | |
| 1339 switches::kEnablePasswordGeneration) ? true : false); | |
|
Ilya Sherman
2012/05/01 22:27:48
nit: Please omit the " ? true : false" -- you alre
zysxqn
2012/05/03 00:57:24
Done.
| |
| 1340 web_ui()->CallJavascriptFunction( | |
| 1341 "BrowserOptions.setPasswordGenerationSettingVisibility", visible); | |
| 1342 } | |
| 1343 | |
| 1333 void BrowserOptionsHandler::SetupFontSizeSelector() { | 1344 void BrowserOptionsHandler::SetupFontSizeSelector() { |
| 1334 // We're only interested in integer values, so convert to int. | 1345 // We're only interested in integer values, so convert to int. |
| 1335 base::FundamentalValue font_size(default_font_size_.GetValue()); | 1346 base::FundamentalValue font_size(default_font_size_.GetValue()); |
| 1336 web_ui()->CallJavascriptFunction("BrowserOptions.setFontSize", font_size); | 1347 web_ui()->CallJavascriptFunction("BrowserOptions.setFontSize", font_size); |
| 1337 } | 1348 } |
| 1338 | 1349 |
| 1339 void BrowserOptionsHandler::SetupPageZoomSelector() { | 1350 void BrowserOptionsHandler::SetupPageZoomSelector() { |
| 1340 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1351 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1341 double default_zoom_level = pref_service->GetDouble(prefs::kDefaultZoomLevel); | 1352 double default_zoom_level = pref_service->GetDouble(prefs::kDefaultZoomLevel); |
| 1342 double default_zoom_factor = | 1353 double default_zoom_factor = |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1412 } | 1423 } |
| 1413 | 1424 |
| 1414 void BrowserOptionsHandler::SetupSSLConfigSettings() { | 1425 void BrowserOptionsHandler::SetupSSLConfigSettings() { |
| 1415 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); | 1426 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); |
| 1416 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); | 1427 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); |
| 1417 web_ui()->CallJavascriptFunction( | 1428 web_ui()->CallJavascriptFunction( |
| 1418 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); | 1429 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); |
| 1419 } | 1430 } |
| 1420 | 1431 |
| 1421 } // namespace options2 | 1432 } // namespace options2 |
| OLD | NEW |