Chromium Code Reviews| Index: chrome/browser/ui/webui/options2/browser_options_handler2.cc |
| diff --git a/chrome/browser/ui/webui/options2/browser_options_handler2.cc b/chrome/browser/ui/webui/options2/browser_options_handler2.cc |
| index c287ebfbcf7383f471b2c2d02c056d5272b26eca..65dc9a31f7a153110a39a4ce6335c2472255b775 100644 |
| --- a/chrome/browser/ui/webui/options2/browser_options_handler2.cc |
| +++ b/chrome/browser/ui/webui/options2/browser_options_handler2.cc |
| @@ -211,6 +211,8 @@ void BrowserOptionsHandler::GetLocalizedValues(DictionaryValue* values) { |
| { "passwordsAndAutofillGroupName", |
| IDS_OPTIONS_PASSWORDS_AND_FORMS_GROUP_NAME }, |
| { "passwordManagerEnabled", IDS_OPTIONS_PASSWORD_MANAGER_ENABLE }, |
| + { "passwordGenerationEnabledDescription", |
| + IDS_OPTIONS_PASSWORD_GENERATION_ENABLED_LABEL }, |
| { "privacyClearDataButton", IDS_OPTIONS_PRIVACY_CLEAR_DATA_BUTTON }, |
| { "privacyContentSettingsButton", |
| IDS_OPTIONS_PRIVACY_CONTENT_SETTINGS_BUTTON }, |
| @@ -615,6 +617,7 @@ void BrowserOptionsHandler::InitializePage() { |
| SetupMetricsReportingCheckbox(); |
| SetupMetricsReportingSettingVisibility(); |
| + SetupPasswordGenerationSettingVisibility(); |
| SetupFontSizeSelector(); |
| SetupPageZoomSelector(); |
| SetupAutoOpenFileTypes(); |
| @@ -1330,6 +1333,14 @@ void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() { |
| #endif |
| } |
| +void BrowserOptionsHandler::SetupPasswordGenerationSettingVisibility() { |
| + base::FundamentalValue visible( |
| + CommandLine::ForCurrentProcess()->HasSwitch( |
| + 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.
|
| + web_ui()->CallJavascriptFunction( |
| + "BrowserOptions.setPasswordGenerationSettingVisibility", visible); |
| +} |
| + |
| void BrowserOptionsHandler::SetupFontSizeSelector() { |
| // We're only interested in integer values, so convert to int. |
| base::FundamentalValue font_size(default_font_size_.GetValue()); |