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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 IDS_OPTIONS_LANGUAGE_AND_SPELLCHECK_BUTTON }, | 207 IDS_OPTIONS_LANGUAGE_AND_SPELLCHECK_BUTTON }, |
208 #endif | 208 #endif |
209 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF }, | 209 { "linkDoctorPref", IDS_OPTIONS_LINKDOCTOR_PREF }, |
210 { "manageAutofillSettings", IDS_OPTIONS_MANAGE_AUTOFILL_SETTINGS_LINK }, | 210 { "manageAutofillSettings", IDS_OPTIONS_MANAGE_AUTOFILL_SETTINGS_LINK }, |
211 { "managePasswords", IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS_LINK }, | 211 { "managePasswords", IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS_LINK }, |
212 { "networkPredictionEnabledDescription", | 212 { "networkPredictionEnabledDescription", |
213 IDS_NETWORK_PREDICTION_ENABLED_DESCRIPTION }, | 213 IDS_NETWORK_PREDICTION_ENABLED_DESCRIPTION }, |
214 { "passwordsAndAutofillGroupName", | 214 { "passwordsAndAutofillGroupName", |
215 IDS_OPTIONS_PASSWORDS_AND_FORMS_GROUP_NAME }, | 215 IDS_OPTIONS_PASSWORDS_AND_FORMS_GROUP_NAME }, |
216 { "passwordManagerEnabled", IDS_OPTIONS_PASSWORD_MANAGER_ENABLE }, | 216 { "passwordManagerEnabled", IDS_OPTIONS_PASSWORD_MANAGER_ENABLE }, |
| 217 { "passwordGenerationEnabledDescription", |
| 218 IDS_OPTIONS_PASSWORD_GENERATION_ENABLED_LABEL }, |
217 { "privacyClearDataButton", IDS_OPTIONS_PRIVACY_CLEAR_DATA_BUTTON }, | 219 { "privacyClearDataButton", IDS_OPTIONS_PRIVACY_CLEAR_DATA_BUTTON }, |
218 { "privacyContentSettingsButton", | 220 { "privacyContentSettingsButton", |
219 IDS_OPTIONS_PRIVACY_CONTENT_SETTINGS_BUTTON }, | 221 IDS_OPTIONS_PRIVACY_CONTENT_SETTINGS_BUTTON }, |
220 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, | 222 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, |
221 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, | 223 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, |
222 { "profilesDeleteSingle", IDS_PROFILES_DELETE_SINGLE_BUTTON_LABEL }, | 224 { "profilesDeleteSingle", IDS_PROFILES_DELETE_SINGLE_BUTTON_LABEL }, |
223 { "profilesListItemCurrent", IDS_PROFILES_LIST_ITEM_CURRENT }, | 225 { "profilesListItemCurrent", IDS_PROFILES_LIST_ITEM_CURRENT }, |
224 { "profilesManage", IDS_PROFILES_MANAGE_BUTTON_LABEL }, | 226 { "profilesManage", IDS_PROFILES_MANAGE_BUTTON_LABEL }, |
225 { "proxiesLabel", IDS_OPTIONS_PROXIES_LABEL }, | 227 { "proxiesLabel", IDS_OPTIONS_PROXIES_LABEL }, |
226 { "safeBrowsingEnableProtection", | 228 { "safeBrowsingEnableProtection", |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 } | 607 } |
606 | 608 |
607 void BrowserOptionsHandler::InitializePage() { | 609 void BrowserOptionsHandler::InitializePage() { |
608 OnTemplateURLServiceChanged(); | 610 OnTemplateURLServiceChanged(); |
609 ObserveThemeChanged(); | 611 ObserveThemeChanged(); |
610 OnStateChanged(); | 612 OnStateChanged(); |
611 UpdateDefaultBrowserState(); | 613 UpdateDefaultBrowserState(); |
612 | 614 |
613 SetupMetricsReportingCheckbox(); | 615 SetupMetricsReportingCheckbox(); |
614 SetupMetricsReportingSettingVisibility(); | 616 SetupMetricsReportingSettingVisibility(); |
| 617 SetupPasswordGenerationSettingVisibility(); |
615 SetupFontSizeSelector(); | 618 SetupFontSizeSelector(); |
616 SetupPageZoomSelector(); | 619 SetupPageZoomSelector(); |
617 SetupAutoOpenFileTypes(); | 620 SetupAutoOpenFileTypes(); |
618 SetupProxySettingsSection(); | 621 SetupProxySettingsSection(); |
619 SetupSSLConfigSettings(); | 622 SetupSSLConfigSettings(); |
620 #if !defined(OS_CHROMEOS) | 623 #if !defined(OS_CHROMEOS) |
621 if (cloud_print_connector_ui_enabled_) { | 624 if (cloud_print_connector_ui_enabled_) { |
622 SetupCloudPrintConnectorSection(); | 625 SetupCloudPrintConnectorSection(); |
623 RefreshCloudPrintStatusFromService(); | 626 RefreshCloudPrintStatusFromService(); |
624 } else { | 627 } else { |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) | 1323 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) |
1321 // Don't show the reporting setting if we are in the guest mode. | 1324 // Don't show the reporting setting if we are in the guest mode. |
1322 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { | 1325 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { |
1323 base::FundamentalValue visible(false); | 1326 base::FundamentalValue visible(false); |
1324 web_ui()->CallJavascriptFunction( | 1327 web_ui()->CallJavascriptFunction( |
1325 "BrowserOptions.setMetricsReportingSettingVisibility", visible); | 1328 "BrowserOptions.setMetricsReportingSettingVisibility", visible); |
1326 } | 1329 } |
1327 #endif | 1330 #endif |
1328 } | 1331 } |
1329 | 1332 |
| 1333 void BrowserOptionsHandler::SetupPasswordGenerationSettingVisibility() { |
| 1334 base::FundamentalValue visible( |
| 1335 CommandLine::ForCurrentProcess()->HasSwitch( |
| 1336 switches::kEnablePasswordGeneration)); |
| 1337 web_ui()->CallJavascriptFunction( |
| 1338 "BrowserOptions.setPasswordGenerationSettingVisibility", visible); |
| 1339 } |
| 1340 |
1330 void BrowserOptionsHandler::SetupFontSizeSelector() { | 1341 void BrowserOptionsHandler::SetupFontSizeSelector() { |
1331 // We're only interested in integer values, so convert to int. | 1342 // We're only interested in integer values, so convert to int. |
1332 base::FundamentalValue font_size(default_font_size_.GetValue()); | 1343 base::FundamentalValue font_size(default_font_size_.GetValue()); |
1333 web_ui()->CallJavascriptFunction("BrowserOptions.setFontSize", font_size); | 1344 web_ui()->CallJavascriptFunction("BrowserOptions.setFontSize", font_size); |
1334 } | 1345 } |
1335 | 1346 |
1336 void BrowserOptionsHandler::SetupPageZoomSelector() { | 1347 void BrowserOptionsHandler::SetupPageZoomSelector() { |
1337 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1348 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1338 double default_zoom_level = pref_service->GetDouble(prefs::kDefaultZoomLevel); | 1349 double default_zoom_level = pref_service->GetDouble(prefs::kDefaultZoomLevel); |
1339 double default_zoom_factor = | 1350 double default_zoom_factor = |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 } | 1420 } |
1410 | 1421 |
1411 void BrowserOptionsHandler::SetupSSLConfigSettings() { | 1422 void BrowserOptionsHandler::SetupSSLConfigSettings() { |
1412 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); | 1423 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); |
1413 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); | 1424 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); |
1414 web_ui()->CallJavascriptFunction( | 1425 web_ui()->CallJavascriptFunction( |
1415 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); | 1426 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); |
1416 } | 1427 } |
1417 | 1428 |
1418 } // namespace options2 | 1429 } // namespace options2 |
OLD | NEW |