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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 VLOG(2) << possible_account_creation_forms_.size() | 232 VLOG(2) << possible_account_creation_forms_.size() |
233 << " possible account creation forms deteceted"; | 233 << " possible account creation forms deteceted"; |
234 DetermineGenerationElement(); | 234 DetermineGenerationElement(); |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 bool PasswordGenerationAgent::ShouldAnalyzeDocument() const { | 238 bool PasswordGenerationAgent::ShouldAnalyzeDocument() const { |
239 // Make sure that this security origin is allowed to use password manager. | 239 // Make sure that this security origin is allowed to use password manager. |
240 // Generating a password that can't be saved is a bad idea. | 240 // Generating a password that can't be saved is a bad idea. |
241 blink::WebSecurityOrigin origin = | 241 blink::WebSecurityOrigin origin = |
242 render_frame()->GetWebFrame()->document().securityOrigin(); | 242 render_frame()->GetWebFrame()->document().getSecurityOrigin(); |
243 if (!origin.canAccessPasswordManager()) { | 243 if (!origin.canAccessPasswordManager()) { |
244 VLOG(1) << "No PasswordManager access"; | 244 VLOG(1) << "No PasswordManager access"; |
245 return false; | 245 return false; |
246 } | 246 } |
247 | 247 |
248 return true; | 248 return true; |
249 } | 249 } |
250 | 250 |
251 bool PasswordGenerationAgent::OnMessageReceived(const IPC::Message& message) { | 251 bool PasswordGenerationAgent::OnMessageReceived(const IPC::Message& message) { |
252 bool handled = true; | 252 bool handled = true; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 GetAccountCreationPasswordFields(form, &password_elements); | 490 GetAccountCreationPasswordFields(form, &password_elements); |
491 password_elements = FindPasswordElementsForGeneration( | 491 password_elements = FindPasswordElementsForGeneration( |
492 password_elements, element->nameForAutofill()); | 492 password_elements, element->nameForAutofill()); |
493 generation_form_data_.reset(new AccountCreationFormData( | 493 generation_form_data_.reset(new AccountCreationFormData( |
494 make_linked_ptr(password_form.release()), password_elements)); | 494 make_linked_ptr(password_form.release()), password_elements)); |
495 is_manually_triggered_ = true; | 495 is_manually_triggered_ = true; |
496 ShowGenerationPopup(); | 496 ShowGenerationPopup(); |
497 } | 497 } |
498 | 498 |
499 } // namespace autofill | 499 } // namespace autofill |
OLD | NEW |