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

Unified Diff: chrome/browser/autofill/autofill_manager.h

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, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autofill/autofill_manager.h
diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h
index 95662166fd807914ddd892837392ba98e2ada560..189d403dde92990030d817488dd245b70a4c60fe 100644
--- a/chrome/browser/autofill/autofill_manager.h
+++ b/chrome/browser/autofill/autofill_manager.h
@@ -23,7 +23,9 @@
#include "chrome/browser/autofill/autofill_download.h"
#include "chrome/browser/autofill/field_types.h"
#include "chrome/browser/autofill/form_structure.h"
+#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/browser/sync/profile_sync_service_observer.h"
+#include "content/public/browser/notification_observer.h"
#include "content/public/browser/web_contents_observer.h"
class AutofillExternalDelegate;
@@ -60,7 +62,8 @@ struct PasswordFormFillData;
// Manages saving and restoring the user's personal information entered into web
// forms.
-class AutofillManager : public content::WebContentsObserver,
+class AutofillManager : public content::NotificationObserver,
+ public content::WebContentsObserver,
public AutofillDownloadManager::Observer,
public ProfileSyncServiceObserver,
public base::RefCounted<AutofillManager> {
@@ -119,8 +122,8 @@ class AutofillManager : public content::WebContentsObserver,
// Reset cache.
void Reset();
- // Informs the renderer of the current password generation state. This is a
- // separate function to aid with testing.
+ // Informs the renderers of the current password generation state.
+ // This is a separate function to aid with testing.
Garrett Casto 2012/05/11 23:01:28 I'm assuming that this is changed because of a syn
zysxqn 2012/05/11 23:52:51 Yes, I don't think I have intended to change this.
Garrett Casto 2012/05/14 20:24:11 It actually only informs one renderer, so changing
zysxqn 2012/05/14 20:47:34 Done.
virtual void SendPasswordGenerationStateToRenderer(
content::RenderViewHost* host,
bool enabled);
@@ -177,8 +180,13 @@ class AutofillManager : public content::WebContentsObserver,
// Register as an observer with the sync service.
void RegisterWithSyncService();
+ // content::NotificationObserver override
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
// Determines what the current state of password generation is, and if it has
- // changed from |password_generation_enabled_|. If it has changed or if
+ // changed from password_generation_enabled_. If it has changed or if
Garrett Casto 2012/05/11 23:01:28 Same as above?
zysxqn 2012/05/11 23:52:51 Yes, again I don't think I have intended to change
// |new_renderer| is true, it notifies the renderer of this change via
// SendPasswordGenerationStateToRenderer.
void UpdatePasswordGenerationState(content::RenderViewHost* host,
@@ -348,6 +356,8 @@ class AutofillManager : public content::WebContentsObserver,
// The ProfileSyncService associated with this tab. This may be NULL in
// testing.
base::WeakPtr<ProfileSyncService> sync_service_;
+ // Listens for changes to the 'enabled' state for password generation.
+ PrefChangeRegistrar registrar_;
// Our copy of the form data.
ScopedVector<FormStructure> form_structures_;

Powered by Google App Engine
This is Rietveld 408576698