OLD | NEW |
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/core/browser/autofill_manager.h" | 5 #include "components/autofill/core/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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 325 } |
326 | 326 |
327 return true; | 327 return true; |
328 } | 328 } |
329 | 329 |
330 void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, | 330 void AutofillManager::OnFormsSeen(const std::vector<FormData>& forms, |
331 const TimeTicks& timestamp, | 331 const TimeTicks& timestamp, |
332 autofill::FormsSeenState state) { | 332 autofill::FormsSeenState state) { |
333 bool is_post_document_load = state == autofill::DYNAMIC_FORMS_SEEN; | 333 bool is_post_document_load = state == autofill::DYNAMIC_FORMS_SEEN; |
334 bool has_more_forms = state == autofill::PARTIAL_FORMS_SEEN; | 334 bool has_more_forms = state == autofill::PARTIAL_FORMS_SEEN; |
335 // If new forms were added via AJAX or DHML, treat as new page. | 335 // If new forms were added dynamically, and the autocheckout manager |
336 if (is_post_document_load) | 336 // doesn't tell us to ignore ajax on this page, treat as a new page. |
| 337 if (is_post_document_load) { |
| 338 if (autocheckout_manager_.ShouldIgnoreAjax()) |
| 339 return; |
| 340 |
337 Reset(); | 341 Reset(); |
| 342 } |
338 | 343 |
339 RenderViewHost* host = driver_->GetWebContents()->GetRenderViewHost(); | 344 RenderViewHost* host = driver_->GetWebContents()->GetRenderViewHost(); |
340 if (!host) | 345 if (!host) |
341 return; | 346 return; |
342 | 347 |
343 if (!GetAutocheckoutURLPrefix().empty()) { | 348 if (!GetAutocheckoutURLPrefix().empty()) { |
344 // If whitelisted URL, fetch all the forms. | 349 // If whitelisted URL, fetch all the forms. |
345 if (has_more_forms) | 350 if (has_more_forms) |
346 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); | 351 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); |
347 if (!is_post_document_load) { | 352 if (!is_post_document_load) { |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 | 1245 |
1241 void AutofillManager::UpdateInitialInteractionTimestamp( | 1246 void AutofillManager::UpdateInitialInteractionTimestamp( |
1242 const TimeTicks& interaction_timestamp) { | 1247 const TimeTicks& interaction_timestamp) { |
1243 if (initial_interaction_timestamp_.is_null() || | 1248 if (initial_interaction_timestamp_.is_null() || |
1244 interaction_timestamp < initial_interaction_timestamp_) { | 1249 interaction_timestamp < initial_interaction_timestamp_) { |
1245 initial_interaction_timestamp_ = interaction_timestamp; | 1250 initial_interaction_timestamp_ = interaction_timestamp; |
1246 } | 1251 } |
1247 } | 1252 } |
1248 | 1253 |
1249 } // namespace autofill | 1254 } // namespace autofill |
OLD | NEW |