| Index: chrome/renderer/autofill/password_generation_manager.cc
|
| diff --git a/chrome/renderer/autofill/password_generation_manager.cc b/chrome/renderer/autofill/password_generation_manager.cc
|
| index 687c035e26579f2a98973b1e5195ebd12bdad4ab..19b0188341580c6f2550fb43f54965273599eb63 100644
|
| --- a/chrome/renderer/autofill/password_generation_manager.cc
|
| +++ b/chrome/renderer/autofill/password_generation_manager.cc
|
| @@ -20,13 +20,14 @@ namespace autofill {
|
| PasswordGenerationManager::PasswordGenerationManager(
|
| content::RenderView* render_view)
|
| : content::RenderViewObserver(render_view),
|
| - enabled_(false) {}
|
| + sync_enabled_(false),
|
| + password_generation_enabled_(false) {}
|
| PasswordGenerationManager::~PasswordGenerationManager() {}
|
|
|
| void PasswordGenerationManager::DidFinishDocumentLoad(WebKit::WebFrame* frame) {
|
| - // We don't want to generate passwords if the browser won't store or sync
|
| - // them.
|
| - if (!enabled_)
|
| + // We don't want to generate passwords if browser won't store or sync them, or
|
| + // password generation isn't enabled.
|
| + if (!sync_enabled_ || !password_generation_enabled_)
|
| return;
|
|
|
| if (!ShouldAnalyzeFrame(*frame))
|
| @@ -90,8 +91,10 @@ bool PasswordGenerationManager::OnMessageReceived(const IPC::Message& message) {
|
| IPC_BEGIN_MESSAGE_MAP(PasswordGenerationManager, message)
|
| IPC_MESSAGE_HANDLER(AutofillMsg_GeneratedPasswordAccepted,
|
| OnPasswordAccepted)
|
| - IPC_MESSAGE_HANDLER(AutofillMsg_PasswordGenerationEnabled,
|
| + IPC_MESSAGE_HANDLER(AutofillMsg_PasswordSyncEnabled,
|
| OnPasswordSyncEnabled)
|
| + IPC_MESSAGE_HANDLER(AutofillMsg_PasswordGenerationEnabled,
|
| + OnPasswordGenerationEnabled)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| return handled;
|
| @@ -107,7 +110,11 @@ void PasswordGenerationManager::OnPasswordAccepted(const string16& password) {
|
| }
|
|
|
| void PasswordGenerationManager::OnPasswordSyncEnabled(bool enabled) {
|
| - enabled_ = enabled;
|
| + sync_enabled_ = enabled;
|
| +}
|
| +
|
| +void PasswordGenerationManager::OnPasswordGenerationEnabled(bool enabled) {
|
| + password_generation_enabled_ = enabled;
|
| }
|
|
|
| } // namespace autofill
|
|
|