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

Side by Side Diff: chrome/browser/ui/webui/options2/browser_options_handler2.cc

Issue 10222017: Make password generation switched by a preference in chrome settings rather than a command line fla… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes from reviews. Created 8 years, 7 months 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 | Annotate | Revision Log
OLDNEW
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
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 PrefSetObserver::CreateProxyPrefSetObserver(prefs, this)); 613 PrefSetObserver::CreateProxyPrefSetObserver(prefs, this));
612 #endif // !defined(OS_CHROMEOS) 614 #endif // !defined(OS_CHROMEOS)
613 } 615 }
614 616
615 void BrowserOptionsHandler::InitializePage() { 617 void BrowserOptionsHandler::InitializePage() {
616 OnTemplateURLServiceChanged(); 618 OnTemplateURLServiceChanged();
617 ObserveThemeChanged(); 619 ObserveThemeChanged();
618 620
619 SetupMetricsReportingCheckbox(); 621 SetupMetricsReportingCheckbox();
620 SetupMetricsReportingSettingVisibility(); 622 SetupMetricsReportingSettingVisibility();
623 SetupPasswordGenerationSettingVisibility();
621 SetupFontSizeSelector(); 624 SetupFontSizeSelector();
622 SetupPageZoomSelector(); 625 SetupPageZoomSelector();
623 SetupAutoOpenFileTypes(); 626 SetupAutoOpenFileTypes();
624 SetupProxySettingsSection(); 627 SetupProxySettingsSection();
625 SetupSSLConfigSettings(); 628 SetupSSLConfigSettings();
626 #if !defined(OS_CHROMEOS) 629 #if !defined(OS_CHROMEOS)
627 if (cloud_print_connector_ui_enabled_) { 630 if (cloud_print_connector_ui_enabled_) {
628 SetupCloudPrintConnectorSection(); 631 SetupCloudPrintConnectorSection();
629 RefreshCloudPrintStatusFromService(); 632 RefreshCloudPrintStatusFromService();
630 } else { 633 } else {
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) 1329 #if defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS)
1327 // Don't show the reporting setting if we are in the guest mode. 1330 // Don't show the reporting setting if we are in the guest mode.
1328 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { 1331 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) {
1329 base::FundamentalValue visible(false); 1332 base::FundamentalValue visible(false);
1330 web_ui()->CallJavascriptFunction( 1333 web_ui()->CallJavascriptFunction(
1331 "BrowserOptions.setMetricsReportingSettingVisibility", visible); 1334 "BrowserOptions.setMetricsReportingSettingVisibility", visible);
1332 } 1335 }
1333 #endif 1336 #endif
1334 } 1337 }
1335 1338
1339 void BrowserOptionsHandler::SetupPasswordGenerationSettingVisibility() {
1340 base::FundamentalValue visible(
1341 CommandLine::ForCurrentProcess()->HasSwitch(
1342 switches::kEnablePasswordGeneration));
1343 web_ui()->CallJavascriptFunction(
1344 "BrowserOptions.setPasswordGenerationSettingVisibility", visible);
1345 }
1346
1336 void BrowserOptionsHandler::SetupFontSizeSelector() { 1347 void BrowserOptionsHandler::SetupFontSizeSelector() {
1337 // We're only interested in integer values, so convert to int. 1348 // We're only interested in integer values, so convert to int.
1338 base::FundamentalValue font_size(default_font_size_.GetValue()); 1349 base::FundamentalValue font_size(default_font_size_.GetValue());
1339 web_ui()->CallJavascriptFunction("BrowserOptions.setFontSize", font_size); 1350 web_ui()->CallJavascriptFunction("BrowserOptions.setFontSize", font_size);
1340 } 1351 }
1341 1352
1342 void BrowserOptionsHandler::SetupPageZoomSelector() { 1353 void BrowserOptionsHandler::SetupPageZoomSelector() {
1343 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); 1354 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
1344 double default_zoom_level = pref_service->GetDouble(prefs::kDefaultZoomLevel); 1355 double default_zoom_level = pref_service->GetDouble(prefs::kDefaultZoomLevel);
1345 double default_zoom_factor = 1356 double default_zoom_factor =
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 } 1426 }
1416 1427
1417 void BrowserOptionsHandler::SetupSSLConfigSettings() { 1428 void BrowserOptionsHandler::SetupSSLConfigSettings() {
1418 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); 1429 base::FundamentalValue checked(rev_checking_enabled_.GetValue());
1419 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); 1430 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged());
1420 web_ui()->CallJavascriptFunction( 1431 web_ui()->CallJavascriptFunction(
1421 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); 1432 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled);
1422 } 1433 }
1423 1434
1424 } // namespace options2 1435 } // namespace options2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698