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

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

Issue 16611003: Ignore ajax on specified pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit tests Created 7 years, 6 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698