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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 blink::WebVector<blink::WebFormElement> forms; | 181 blink::WebVector<blink::WebFormElement> forms; |
182 render_frame()->GetWebFrame()->document().forms(forms); | 182 render_frame()->GetWebFrame()->document().forms(forms); |
183 for (size_t i = 0; i < forms.size(); ++i) { | 183 for (size_t i = 0; i < forms.size(); ++i) { |
184 if (forms[i].isNull()) | 184 if (forms[i].isNull()) |
185 continue; | 185 continue; |
186 | 186 |
187 // If we can't get a valid PasswordForm, we skip this form because the | 187 // If we can't get a valid PasswordForm, we skip this form because the |
188 // the password won't get saved even if we generate it. | 188 // the password won't get saved even if we generate it. |
189 scoped_ptr<PasswordForm> password_form( | 189 scoped_ptr<PasswordForm> password_form( |
190 CreatePasswordForm(forms[i], nullptr)); | 190 CreatePasswordForm(forms[i], nullptr, nullptr)); |
191 if (!password_form.get()) { | 191 if (!password_form.get()) { |
192 VLOG(2) << "Skipping form as it would not be saved"; | 192 VLOG(2) << "Skipping form as it would not be saved"; |
193 continue; | 193 continue; |
194 } | 194 } |
195 | 195 |
196 // Do not generate password for GAIA since it is used to retrieve the | 196 // Do not generate password for GAIA since it is used to retrieve the |
197 // generated paswords. | 197 // generated paswords. |
198 GURL realm(password_form->signon_realm); | 198 GURL realm(password_form->signon_realm); |
199 if (realm == GaiaUrls::GetInstance()->gaia_login_form_realm()) | 199 if (realm == GaiaUrls::GetInstance()->gaia_login_form_realm()) |
200 continue; | 200 continue; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 *generation_form_data_->form)); | 412 *generation_form_data_->form)); |
413 | 413 |
414 editing_popup_shown_ = true; | 414 editing_popup_shown_ = true; |
415 } | 415 } |
416 | 416 |
417 void PasswordGenerationAgent::HidePopup() { | 417 void PasswordGenerationAgent::HidePopup() { |
418 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id())); | 418 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id())); |
419 } | 419 } |
420 | 420 |
421 } // namespace autofill | 421 } // namespace autofill |
OLD | NEW |