| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/renderer/password_generation_agent.h" | 5 #include "components/autofill/content/renderer/password_generation_agent.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/autofill/content/common/autofill_messages.h" | 10 #include "components/autofill/content/common/autofill_messages.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 password_generation::LogPasswordGenerationEvent( | 148 password_generation::LogPasswordGenerationEvent( |
| 149 password_generation::GENERATION_POPUP_SHOWN); | 149 password_generation::GENERATION_POPUP_SHOWN); |
| 150 } | 150 } |
| 151 generation_popup_shown_ = false; | 151 generation_popup_shown_ = false; |
| 152 | 152 |
| 153 if (editing_popup_shown_) { | 153 if (editing_popup_shown_) { |
| 154 password_generation::LogPasswordGenerationEvent( | 154 password_generation::LogPasswordGenerationEvent( |
| 155 password_generation::EDITING_POPUP_SHOWN); | 155 password_generation::EDITING_POPUP_SHOWN); |
| 156 } | 156 } |
| 157 editing_popup_shown_ = false; | 157 editing_popup_shown_ = false; |
| 158 |
| 159 FindPossibleGenerationForm(); |
| 158 } | 160 } |
| 159 | 161 |
| 160 void PasswordGenerationAgent::OnDynamicFormsSeen() { | 162 void PasswordGenerationAgent::OnDynamicFormsSeen() { |
| 161 FindPossibleGenerationForm(); | 163 FindPossibleGenerationForm(); |
| 162 } | 164 } |
| 163 | 165 |
| 164 void PasswordGenerationAgent::DidFinishLoad() { | |
| 165 FindPossibleGenerationForm(); | |
| 166 } | |
| 167 | |
| 168 void PasswordGenerationAgent::FindPossibleGenerationForm() { | 166 void PasswordGenerationAgent::FindPossibleGenerationForm() { |
| 169 if (!enabled_) | 167 if (!enabled_) |
| 170 return; | 168 return; |
| 171 | 169 |
| 172 // We don't want to generate passwords if the browser won't store or sync | 170 // We don't want to generate passwords if the browser won't store or sync |
| 173 // them. | 171 // them. |
| 174 if (!ShouldAnalyzeDocument()) | 172 if (!ShouldAnalyzeDocument()) |
| 175 return; | 173 return; |
| 176 | 174 |
| 177 // If we have already found a signup form for this page, no need to continue. | 175 // If we have already found a signup form for this page, no need to continue. |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 *generation_form_data_->form)); | 410 *generation_form_data_->form)); |
| 413 | 411 |
| 414 editing_popup_shown_ = true; | 412 editing_popup_shown_ = true; |
| 415 } | 413 } |
| 416 | 414 |
| 417 void PasswordGenerationAgent::HidePopup() { | 415 void PasswordGenerationAgent::HidePopup() { |
| 418 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id())); | 416 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id())); |
| 419 } | 417 } |
| 420 | 418 |
| 421 } // namespace autofill | 419 } // namespace autofill |
| OLD | NEW |