Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 22926033: Enable password saving for dynamic password forms (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits fixed Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « components/autofill/content/renderer/password_autofill_agent.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 return false; 349 return false;
350 350
351 return ShowSuggestionPopup(iter->second.fill_data, element); 351 return ShowSuggestionPopup(iter->second.fill_data, element);
352 } 352 }
353 353
354 bool PasswordAutofillAgent::OriginCanAccessPasswordManager( 354 bool PasswordAutofillAgent::OriginCanAccessPasswordManager(
355 const WebKit::WebSecurityOrigin& origin) { 355 const WebKit::WebSecurityOrigin& origin) {
356 return origin.canAccessPasswordManager(); 356 return origin.canAccessPasswordManager();
357 } 357 }
358 358
359 void PasswordAutofillAgent::OnDynamicFormsSeen(WebKit::WebFrame* frame) {
360 SendPasswordForms(frame, false /* only_visible */);
361 }
362
359 void PasswordAutofillAgent::SendPasswordForms(WebKit::WebFrame* frame, 363 void PasswordAutofillAgent::SendPasswordForms(WebKit::WebFrame* frame,
360 bool only_visible) { 364 bool only_visible) {
361 // Make sure that this security origin is allowed to use password manager. 365 // Make sure that this security origin is allowed to use password manager.
362 WebKit::WebSecurityOrigin origin = frame->document().securityOrigin(); 366 WebKit::WebSecurityOrigin origin = frame->document().securityOrigin();
363 if (!OriginCanAccessPasswordManager(origin)) 367 if (!OriginCanAccessPasswordManager(origin))
364 return; 368 return;
365 369
366 // Checks whether the webpage is a redirect page or an empty page. 370 // Checks whether the webpage is a redirect page or an empty page.
367 if (IsWebpageEmpty(frame)) 371 if (IsWebpageEmpty(frame))
368 return; 372 return;
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); 743 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input);
740 if (iter == login_to_password_info_.end()) 744 if (iter == login_to_password_info_.end())
741 return false; 745 return false;
742 746
743 *found_input = input; 747 *found_input = input;
744 *found_password = iter->second; 748 *found_password = iter->second;
745 return true; 749 return true;
746 } 750 }
747 751
748 } // namespace autofill 752 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/content/renderer/password_autofill_agent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698