summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorgcasto@chromium.org <gcasto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-23 22:59:47 +0000
committergcasto@chromium.org <gcasto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-23 22:59:47 +0000
commit6feec4977810d1a5468eafd6c0bb9687b246f427 (patch)
treeeeff62b558a8d1c14acc603d21386187b357d193 /chrome
parent14cfbd6a8c4fdaf0f72bf5c1be3b6529e71292e7 (diff)
downloadchromium_src-6feec4977810d1a5468eafd6c0bb9687b246f427.zip
chromium_src-6feec4977810d1a5468eafd6c0bb9687b246f427.tar.gz
chromium_src-6feec4977810d1a5468eafd6c0bb9687b246f427.tar.bz2
[Password Generation] Remove separate pref.
This feature will just be considered part of the password manager instead of having it's own opt out. BUG=333535 Review URL: https://codereview.chromium.org/144813002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246711 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/generated_resources.grd3
-rw-r--r--chrome/browser/password_manager/password_generation_manager.cc22
-rw-r--r--chrome/browser/password_manager/password_generation_manager.h2
-rw-r--r--chrome/browser/password_manager/password_generation_manager_unittest.cc15
-rw-r--r--chrome/browser/prefs/browser_prefs.cc2
-rw-r--r--chrome/browser/resources/options/browser_options.html7
-rw-r--r--chrome/browser/resources/options/browser_options.js12
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.cc11
-rw-r--r--chrome/browser/ui/webui/options/browser_options_handler.h3
-rw-r--r--chrome/common/pref_names.cc4
-rw-r--r--chrome/common/pref_names.h1
11 files changed, 3 insertions, 79 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 6ab8055..adb8cbc 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -10616,9 +10616,6 @@ Would you like to start <ph name="CONTROL_PANEL_APPLET_NAME">$1<ex>Add/Remove Pr
<message name="IDS_OPTIONS_SAFEBROWSING_ENABLEPROTECTION" desc="The label of the 'Enable phishing and malware protection' checkbox">
Enable phishing and malware protection
</message>
- <message name="IDS_OPTIONS_PASSWORD_GENERATION_ENABLED_LABEL" desc="The label of the 'Enable automatic password generation' checkbox">
- Enable automatic password generation
- </message>
<message name="IDS_OPTIONS_SSL_CHECKREVOCATION" desc="The label of the 'Check for server certificate revocation' checkbox">
Check for server certificate revocation
</message>
diff --git a/chrome/browser/password_manager/password_generation_manager.cc b/chrome/browser/password_manager/password_generation_manager.cc
index 0124fc4..0528120 100644
--- a/chrome/browser/password_manager/password_generation_manager.cc
+++ b/chrome/browser/password_manager/password_generation_manager.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/password_manager/password_generation_manager.h"
-#include "base/prefs/pref_service.h"
#include "chrome/browser/password_manager/password_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
@@ -12,7 +11,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
-#include "chrome/common/pref_names.h"
#include "components/autofill/content/common/autofill_messages.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/field_types.h"
@@ -20,7 +18,6 @@
#include "components/autofill/core/browser/password_generator.h"
#include "components/autofill/core/common/form_data.h"
#include "components/autofill/core/common/password_form.h"
-#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -35,15 +32,6 @@ PasswordGenerationManager::PasswordGenerationManager(
PasswordGenerationManager::~PasswordGenerationManager() {}
-// static
-void PasswordGenerationManager::RegisterProfilePrefs(
- user_prefs::PrefRegistrySyncable* registry) {
- registry->RegisterBooleanPref(
- prefs::kPasswordGenerationEnabled,
- true,
- user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
-}
-
void PasswordGenerationManager::DetectAccountCreationForms(
const std::vector<autofill::FormStructure*>& forms) {
std::vector<autofill::FormData> account_creation_forms;
@@ -77,9 +65,8 @@ bool PasswordGenerationManager::OnMessageReceived(const IPC::Message& message) {
}
// In order for password generation to be enabled, we need to make sure:
-// (1) Password sync is enabled,
-// (2) Password manager is enabled, and
-// (3) Password generation preference check box is checked.
+// (1) Password sync is enabled, and
+// (2) Password saving is enabled.
bool PasswordGenerationManager::IsGenerationEnabled() const {
if (!web_contents())
return false;
@@ -105,11 +92,6 @@ bool PasswordGenerationManager::IsGenerationEnabled() const {
return false;
}
- if (!profile->GetPrefs()->GetBoolean(prefs::kPasswordGenerationEnabled)) {
- DVLOG(2) << "Generation disabled by user";
- return false;
- }
-
return true;
}
diff --git a/chrome/browser/password_manager/password_generation_manager.h b/chrome/browser/password_manager/password_generation_manager.h
index c9382bb..6d0a7ff 100644
--- a/chrome/browser/password_manager/password_generation_manager.h
+++ b/chrome/browser/password_manager/password_generation_manager.h
@@ -25,7 +25,6 @@ class PrefRegistrySyncable;
//
// - Password manager is enabled
// - Password sync is enabled
-// - Password generation pref is enabled
//
// NOTE: At the moment, the creation of the renderer PasswordGenerationManager
// is controlled by a switch (--enable-password-generation) so this feature will
@@ -39,7 +38,6 @@ class PasswordGenerationManager
: public content::WebContentsObserver,
public content::WebContentsUserData<PasswordGenerationManager> {
public:
- static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
virtual ~PasswordGenerationManager();
// Detect account creation forms from forms with autofill type annotated.
diff --git a/chrome/browser/password_manager/password_generation_manager_unittest.cc b/chrome/browser/password_manager/password_generation_manager_unittest.cc
index dd2e8b1..beb589b 100644
--- a/chrome/browser/password_manager/password_generation_manager_unittest.cc
+++ b/chrome/browser/password_manager/password_generation_manager_unittest.cc
@@ -111,8 +111,7 @@ TEST_F(PasswordGenerationManagerTest, IsGenerationEnabled) {
PrefService* prefs = profile()->GetPrefs();
- // Always set password sync enabled so we can test the behavior of password
- // generation.
+ // Enable syncing. Generation should be enabled.
prefs->SetBoolean(prefs::kSyncKeepEverythingSynced, false);
ProfileSyncService* sync_service = ProfileSyncServiceFactory::GetForProfile(
profile());
@@ -120,13 +119,6 @@ TEST_F(PasswordGenerationManagerTest, IsGenerationEnabled) {
syncer::ModelTypeSet preferred_set;
preferred_set.Put(syncer::PASSWORDS);
sync_service->ChangePreferredDataTypes(preferred_set);
-
- // Pref is false, should not be enabled.
- prefs->SetBoolean(prefs::kPasswordGenerationEnabled, false);
- EXPECT_FALSE(IsGenerationEnabled());
-
- // Pref is true, should be enabled.
- prefs->SetBoolean(prefs::kPasswordGenerationEnabled, true);
EXPECT_TRUE(IsGenerationEnabled());
// Change syncing preferences to not include passwords. Generation should
@@ -152,8 +144,6 @@ TEST_F(PasswordGenerationManagerTest, DetectAccountCreationForms) {
profile());
sync_service->SetSyncSetupCompleted();
- profile()->GetPrefs()->SetBoolean(prefs::kPasswordGenerationEnabled, true);
-
autofill::FormData login_form;
login_form.origin = GURL("http://www.yahoo.com/login/");
autofill::FormFieldData username;
@@ -216,9 +206,6 @@ TEST_F(IncognitoPasswordGenerationManagerTest,
// Allow this test to control what should get synced.
prefs->SetBoolean(prefs::kSyncKeepEverythingSynced, false);
- // Always set password generation enabled check box so we can test the
- // behavior of password sync.
- prefs->SetBoolean(prefs::kPasswordGenerationEnabled, true);
browser_sync::SyncPrefs sync_prefs(profile()->GetPrefs());
sync_prefs.SetSyncSetupCompleted();
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 0bb4081..84aa551 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -50,7 +50,6 @@
#include "chrome/browser/network_time/network_time_service.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/notification_prefs_manager.h"
-#include "chrome/browser/password_manager/password_generation_manager.h"
#include "chrome/browser/password_manager/password_manager.h"
#include "chrome/browser/pepper_flash_settings_manager.h"
#include "chrome/browser/plugins/plugin_finder.h"
@@ -355,7 +354,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
NetPrefObserver::RegisterProfilePrefs(registry);
NetworkTimeService::RegisterProfilePrefs(registry);
NewTabUI::RegisterProfilePrefs(registry);
- PasswordGenerationManager::RegisterProfilePrefs(registry);
PasswordManager::RegisterProfilePrefs(registry);
PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry);
PrefsTabHelper::RegisterProfilePrefs(registry);
diff --git a/chrome/browser/resources/options/browser_options.html b/chrome/browser/resources/options/browser_options.html
index e691206d..5fdaadd 100644
--- a/chrome/browser/resources/options/browser_options.html
+++ b/chrome/browser/resources/options/browser_options.html
@@ -471,13 +471,6 @@
</span>
</span>
</div>
- <div class="checkbox" id="password-generation-checkbox">
- <label>
- <input id="password-generation-enabled" pref="password_generation.enabled"
- metric="Options_PasswordGenerationCheckbox" type="checkbox">
- <span i18n-content="passwordGenerationEnabledDescription"></span>
- </label>
- </div>
<if expr="is_macosx">
<div id="mac-passwords-warning" i18n-content="macPasswordsWarning" hidden>
</div>
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index 14926d3..92b5656 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -1296,17 +1296,6 @@ cr.define('options', function() {
},
/**
- * Set the visibility of the password generation checkbox.
- * @private
- */
- setPasswordGenerationSettingVisibility_: function(visible) {
- if (visible)
- $('password-generation-checkbox').style.display = 'block';
- else
- $('password-generation-checkbox').style.display = 'none';
- },
-
- /**
* Set the font size selected item. This item actually reflects two
* preferences: the default font size and the default fixed font size.
*
@@ -1603,7 +1592,6 @@ cr.define('options', function() {
'setHighContrastCheckboxState',
'setMetricsReportingCheckboxState',
'setMetricsReportingSettingVisibility',
- 'setPasswordGenerationSettingVisibility',
'setProfilesInfo',
'setSpokenFeedbackCheckboxState',
'setThemesResetButtonEnabled',
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index d3b5041..617ef79 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -69,7 +69,6 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chromeos/chromeos_switches.h"
-#include "components/autofill/core/common/password_generation_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/navigation_controller.h"
@@ -276,8 +275,6 @@ void BrowserOptionsHandler::GetLocalizedValues(base::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 },
@@ -842,7 +839,6 @@ void BrowserOptionsHandler::InitializePage() {
UpdateDefaultBrowserState();
SetupMetricsReportingSettingVisibility();
- SetupPasswordGenerationSettingVisibility();
SetupFontSizeSelector();
SetupPageZoomSelector();
SetupAutoOpenFileTypes();
@@ -1589,13 +1585,6 @@ void BrowserOptionsHandler::SetupMetricsReportingSettingVisibility() {
#endif
}
-void BrowserOptionsHandler::SetupPasswordGenerationSettingVisibility() {
- base::FundamentalValue visible(
- autofill::password_generation::IsPasswordGenerationEnabled());
- web_ui()->CallJavascriptFunction(
- "BrowserOptions.setPasswordGenerationSettingVisibility", visible);
-}
-
void BrowserOptionsHandler::SetupFontSizeSelector() {
PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
const PrefService::Preference* default_font_size =
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.h b/chrome/browser/ui/webui/options/browser_options_handler.h
index a218d89..c456c17 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.h
+++ b/chrome/browser/ui/webui/options/browser_options_handler.h
@@ -275,9 +275,6 @@ class BrowserOptionsHandler
// Setup the visibility for the metrics reporting setting.
void SetupMetricsReportingSettingVisibility();
- // Setup the visibility for the password generation setting.
- void SetupPasswordGenerationSettingVisibility();
-
// Setup the font size selector control.
void SetupFontSizeSelector();
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index c87909e..930dbfa 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -300,10 +300,6 @@ const char kShowAppsShortcutInBookmarkBar[] = "bookmark_bar.show_apps_shortcut";
// the bookmark editor.
const char kBookmarkEditorExpandedNodes[] = "bookmark_editor.expanded_nodes";
-// Boolean controlling whether password generation is enabled (will allow users
-// to generated passwords on account creation pages).
-const char kPasswordGenerationEnabled[] = "password_generation.enabled";
-
// Boolean that is true if the password manager is on (will record new
// passwords and fill in known passwords).
const char kPasswordManagerEnabled[] = "profile.password_manager_enabled";
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 732a438..3253249 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -130,7 +130,6 @@ extern const char kWebKitFontScaleFactor[];
extern const char kWebKitForceEnableZoom[];
extern const char kWebKitPasswordEchoEnabled[];
#endif
-extern const char kPasswordGenerationEnabled[];
extern const char kPasswordManagerEnabled[];
extern const char kPasswordManagerAllowShowPasswords[];
extern const char kPasswordManagerGroupsForDomains[];