| 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_autofill_agent.h" | 5 #include "components/autofill/content/renderer/password_autofill_agent.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 return false; | 347 return false; |
| 348 | 348 |
| 349 return ShowSuggestionPopup(iter->second.fill_data, element); | 349 return ShowSuggestionPopup(iter->second.fill_data, element); |
| 350 } | 350 } |
| 351 | 351 |
| 352 bool PasswordAutofillAgent::OriginCanAccessPasswordManager( | 352 bool PasswordAutofillAgent::OriginCanAccessPasswordManager( |
| 353 const WebKit::WebSecurityOrigin& origin) { | 353 const WebKit::WebSecurityOrigin& origin) { |
| 354 return origin.canAccessPasswordManager(); | 354 return origin.canAccessPasswordManager(); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void PasswordAutofillAgent::OnDynamicFormsSeen(WebKit::WebFrame* frame) { |
| 358 SendPasswordForms(frame, false /* only_visible */); |
| 359 } |
| 360 |
| 357 void PasswordAutofillAgent::SendPasswordForms(WebKit::WebFrame* frame, | 361 void PasswordAutofillAgent::SendPasswordForms(WebKit::WebFrame* frame, |
| 358 bool only_visible) { | 362 bool only_visible) { |
| 359 // Make sure that this security origin is allowed to use password manager. | 363 // Make sure that this security origin is allowed to use password manager. |
| 360 WebKit::WebSecurityOrigin origin = frame->document().securityOrigin(); | 364 WebKit::WebSecurityOrigin origin = frame->document().securityOrigin(); |
| 361 if (!OriginCanAccessPasswordManager(origin)) | 365 if (!OriginCanAccessPasswordManager(origin)) |
| 362 return; | 366 return; |
| 363 | 367 |
| 364 WebKit::WebVector<WebKit::WebFormElement> forms; | 368 WebKit::WebVector<WebKit::WebFormElement> forms; |
| 365 frame->document().forms(forms); | 369 frame->document().forms(forms); |
| 366 | 370 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); | 740 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); |
| 737 if (iter == login_to_password_info_.end()) | 741 if (iter == login_to_password_info_.end()) |
| 738 return false; | 742 return false; |
| 739 | 743 |
| 740 *found_input = input; | 744 *found_input = input; |
| 741 *found_password = iter->second; | 745 *found_password = iter->second; |
| 742 return true; | 746 return true; |
| 743 } | 747 } |
| 744 | 748 |
| 745 } // namespace autofill | 749 } // namespace autofill |
| OLD | NEW |