Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 autofill::FormsSeenParam param) { |
| 452 bool is_post_document_load = param & autofill::DYNAMIC_FORMS_SEEN; | |
| 453 bool has_more_forms = param & autofill::PARTIAL_FORMS_SEEN; | |
| 454 // if new forms were added via AJAX or DHML, treat as new page. | |
|
Raman Kakilate
2013/04/02 20:30:19
nit: *I*f new forms...
Dane Wallinga
2013/04/02 21:29:30
Done.
| |
| 455 if (is_post_document_load) | |
| 456 Reset(); | |
| 457 | |
| 452 RenderViewHost* host = web_contents()->GetRenderViewHost(); | 458 RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 453 if (!host) | 459 if (!host) |
| 454 return; | 460 return; |
| 455 | 461 |
| 456 if (!GetAutocheckoutURLPrefix().empty()) { | 462 if (!GetAutocheckoutURLPrefix().empty()) { |
| 457 host->Send( | 463 if (!is_post_document_load) { |
| 458 new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID())); | 464 host->Send( |
| 465 new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID())); | |
| 466 } | |
| 459 // If whitelisted URL, fetch all the forms. | 467 // If whitelisted URL, fetch all the forms. |
| 460 if (has_more_forms) { | 468 if (has_more_forms) { |
| 461 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); | 469 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); |
| 462 return; | 470 return; |
| 463 } | 471 } |
| 464 } | 472 } |
| 465 | 473 |
| 466 autocheckout_manager_.OnFormsSeen(); | 474 autocheckout_manager_.OnFormsSeen(); |
| 467 bool enabled = IsAutofillEnabled(); | 475 bool enabled = IsAutofillEnabled(); |
| 468 if (!has_logged_autofill_enabled_) { | 476 if (!has_logged_autofill_enabled_) { |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1332 *profile_guid = IDToGUID(profile_id); | 1340 *profile_guid = IDToGUID(profile_id); |
| 1333 } | 1341 } |
| 1334 | 1342 |
| 1335 void AutofillManager::UpdateInitialInteractionTimestamp( | 1343 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1336 const TimeTicks& interaction_timestamp) { | 1344 const TimeTicks& interaction_timestamp) { |
| 1337 if (initial_interaction_timestamp_.is_null() || | 1345 if (initial_interaction_timestamp_.is_null() || |
| 1338 interaction_timestamp < initial_interaction_timestamp_) { | 1346 interaction_timestamp < initial_interaction_timestamp_) { |
| 1339 initial_interaction_timestamp_ = interaction_timestamp; | 1347 initial_interaction_timestamp_ = interaction_timestamp; |
| 1340 } | 1348 } |
| 1341 } | 1349 } |
| OLD | NEW |