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

Side by Side Diff: components/autofill/browser/autofill_manager.cc

Issue 13264002: Requery the autofill server when forms and input fields are dynamically added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: and again, except this time remembering to hit save first. Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/autofill_manager.h" 5 #include "components/autofill/browser/autofill_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 forms_loaded_timestamp_, 441 forms_loaded_timestamp_,
442 initial_interaction_timestamp_, 442 initial_interaction_timestamp_,
443 timestamp)); 443 timestamp));
444 } 444 }
445 445
446 return true; 446 return true;
447 } 447 }
448 448
449 void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, 449 void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms,
450 const TimeTicks& timestamp, 450 const TimeTicks& timestamp,
451 bool has_more_forms) { 451 bool has_more_forms,
452 bool is_post_document_load) {
453 // if new forms were added via AJAX or DHML, treat as new page.
ahutter 2013/03/29 21:53:08 nit: If
Dane Wallinga 2013/04/02 19:50:54 Done.
454 if (is_post_document_load)
455 Reset();
ahutter 2013/03/29 21:53:08 Maybe a newline after this.
Dane Wallinga 2013/04/02 19:50:54 Done.
452 RenderViewHost* host = web_contents()->GetRenderViewHost(); 456 RenderViewHost* host = web_contents()->GetRenderViewHost();
453 if (!host) 457 if (!host)
454 return; 458 return;
455 459
456 if (!GetAutocheckoutURLPrefix().empty()) { 460 if (!GetAutocheckoutURLPrefix().empty()) {
457 host->Send( 461 if (!is_post_document_load) {
458 new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID())); 462 host->Send(
463 new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID()));
464 }
459 // If whitelisted URL, fetch all the forms. 465 // If whitelisted URL, fetch all the forms.
460 if (has_more_forms) { 466 if (has_more_forms) {
461 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); 467 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID()));
462 return; 468 return;
463 } 469 }
464 } 470 }
465 471
466 autocheckout_manager_.OnFormsSeen(); 472 autocheckout_manager_.OnFormsSeen();
467 bool enabled = IsAutofillEnabled(); 473 bool enabled = IsAutofillEnabled();
468 if (!has_logged_autofill_enabled_) { 474 if (!has_logged_autofill_enabled_) {
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 *profile_guid = IDToGUID(profile_id); 1340 *profile_guid = IDToGUID(profile_id);
1335 } 1341 }
1336 1342
1337 void AutofillManager::UpdateInitialInteractionTimestamp( 1343 void AutofillManager::UpdateInitialInteractionTimestamp(
1338 const TimeTicks& interaction_timestamp) { 1344 const TimeTicks& interaction_timestamp) {
1339 if (initial_interaction_timestamp_.is_null() || 1345 if (initial_interaction_timestamp_.is_null() ||
1340 interaction_timestamp < initial_interaction_timestamp_) { 1346 interaction_timestamp < initial_interaction_timestamp_) {
1341 initial_interaction_timestamp_ = interaction_timestamp; 1347 initial_interaction_timestamp_ = interaction_timestamp;
1342 } 1348 }
1343 } 1349 }
OLDNEW
« no previous file with comments | « components/autofill/browser/autofill_manager.h ('k') | components/autofill/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698