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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
378 } | 378 } |
379 | 379 |
380 return true; | 380 return true; |
381 } | 381 } |
382 | 382 |
383 void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, | 383 void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, |
384 const TimeTicks& timestamp, | 384 const TimeTicks& timestamp, |
385 autofill::FormsSeenState state) { | 385 autofill::FormsSeenState state) { |
386 bool is_post_document_load = state == autofill::DYNAMIC_FORMS_SEEN; | 386 bool is_post_document_load = state == autofill::DYNAMIC_FORMS_SEEN; |
387 bool has_more_forms = state == autofill::PARTIAL_FORMS_SEEN; | 387 bool has_more_forms = state == autofill::PARTIAL_FORMS_SEEN; |
388 // If new forms were added via AJAX or DHML, treat as new page. | 388 // If new forms were added dynamically, and the autocheckout manager |
389 if (is_post_document_load) | 389 // doesn't tell us to ignore ajax on this page, treat as a new page. |
390 Reset(); | 390 if (is_post_document_load) { |
391 if (autocheckout_manager_.ShouldIgnoreAjax()) | |
392 return; | |
393 else | |
Ilya Sherman
2013/06/19 23:25:13
nit: No else stmt after a return, plz.
Dane Wallinga
2013/06/20 19:46:41
Done.
| |
394 Reset(); | |
395 } | |
391 | 396 |
392 RenderViewHost* host = driver_->GetWebContents()->GetRenderViewHost(); | 397 RenderViewHost* host = driver_->GetWebContents()->GetRenderViewHost(); |
393 if (!host) | 398 if (!host) |
394 return; | 399 return; |
395 | 400 |
396 if (!GetAutocheckoutURLPrefix().empty()) { | 401 if (!GetAutocheckoutURLPrefix().empty()) { |
397 // If whitelisted URL, fetch all the forms. | 402 // If whitelisted URL, fetch all the forms. |
398 if (has_more_forms) | 403 if (has_more_forms) |
399 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); | 404 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); |
400 if (!is_post_document_load) { | 405 if (!is_post_document_load) { |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1293 | 1298 |
1294 void AutofillManager::UpdateInitialInteractionTimestamp( | 1299 void AutofillManager::UpdateInitialInteractionTimestamp( |
1295 const TimeTicks& interaction_timestamp) { | 1300 const TimeTicks& interaction_timestamp) { |
1296 if (initial_interaction_timestamp_.is_null() || | 1301 if (initial_interaction_timestamp_.is_null() || |
1297 interaction_timestamp < initial_interaction_timestamp_) { | 1302 interaction_timestamp < initial_interaction_timestamp_) { |
1298 initial_interaction_timestamp_ = interaction_timestamp; | 1303 initial_interaction_timestamp_ = interaction_timestamp; |
1299 } | 1304 } |
1300 } | 1305 } |
1301 | 1306 |
1302 } // namespace autofill | 1307 } // namespace autofill |
OLD | NEW |