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 bool has_more_forms, |
| 452 bool is_post_document_load) { | |
| 453 // if new forms are the result of AJAX or DHML, treat as new page. | |
|
ahutter
2013/03/29 19:48:31
"If new forms were added via AJAX or DHTML..."
Dane Wallinga
2013/03/29 21:41:12
Done.
| |
| 454 if (is_post_document_load) | |
| 455 Reset(); | |
| 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) |
|
ahutter
2013/03/29 19:48:31
curlies since this is multiline
Dane Wallinga
2013/03/29 21:41:12
Even if it's just one statement with wrapping? Chr
| |
| 458 new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID())); | 462 host->Send( |
| 463 new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID())); | |
| 459 // If whitelisted URL, fetch all the forms. | 464 // If whitelisted URL, fetch all the forms. |
| 460 if (has_more_forms) { | 465 if (has_more_forms) { |
| 461 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); | 466 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); |
| 462 return; | 467 return; |
| 463 } | 468 } |
| 464 } | 469 } |
| 465 | 470 |
| 466 autocheckout_manager_.OnFormsSeen(); | 471 autocheckout_manager_.OnFormsSeen(); |
| 467 bool enabled = IsAutofillEnabled(); | 472 bool enabled = IsAutofillEnabled(); |
| 468 if (!has_logged_autofill_enabled_) { | 473 if (!has_logged_autofill_enabled_) { |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1334 *profile_guid = IDToGUID(profile_id); | 1339 *profile_guid = IDToGUID(profile_id); |
| 1335 } | 1340 } |
| 1336 | 1341 |
| 1337 void AutofillManager::UpdateInitialInteractionTimestamp( | 1342 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1338 const TimeTicks& interaction_timestamp) { | 1343 const TimeTicks& interaction_timestamp) { |
| 1339 if (initial_interaction_timestamp_.is_null() || | 1344 if (initial_interaction_timestamp_.is_null() || |
| 1340 interaction_timestamp < initial_interaction_timestamp_) { | 1345 interaction_timestamp < initial_interaction_timestamp_) { |
| 1341 initial_interaction_timestamp_ = interaction_timestamp; | 1346 initial_interaction_timestamp_ = interaction_timestamp; |
| 1342 } | 1347 } |
| 1343 } | 1348 } |
| OLD | NEW |