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

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

Issue 13947035: Fail autocheckout if there is no forms in the page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 host->Send( 459 host->Send(
460 new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID())); 460 new AutofillMsg_WhitelistedForAutocheckout(host->GetRoutingID()));
461 // If whitelisted URL, fetch all the forms. 461 // If whitelisted URL, fetch all the forms.
462 if (has_more_forms) { 462 if (has_more_forms) {
463 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID())); 463 host->Send(new AutofillMsg_GetAllForms(host->GetRoutingID()));
464 return; 464 return;
465 } 465 }
466 } 466 }
467 467
468 autocheckout_manager_.OnFormsSeen(); 468 autocheckout_manager_.OnFormsSeen();
469 if (forms.empty()) {
470 // Call OnLoadedPageMetaData with no page metadata immediately if there is
471 // no form in the page. This give autocheckout_manager a chance to terminate
ahutter 2013/04/10 20:00:59 nit: |autocheckout_manager_|
benquan 2013/04/10 20:12:59 Done.
472 // autocheckout and send autocheckout status.
ahutter 2013/04/10 20:00:59 nit: Autocheckout and either SendAutocheckoutStatu
benquan 2013/04/10 20:12:59 Done.
473 autocheckout_manager_.OnLoadedPageMetaData(
474 scoped_ptr<autofill::AutocheckoutPageMetaData>(NULL));
475 }
476
469 bool enabled = IsAutofillEnabled(); 477 bool enabled = IsAutofillEnabled();
470 if (!has_logged_autofill_enabled_) { 478 if (!has_logged_autofill_enabled_) {
471 metric_logger_->LogIsAutofillEnabledAtPageLoad(enabled); 479 metric_logger_->LogIsAutofillEnabledAtPageLoad(enabled);
472 has_logged_autofill_enabled_ = true; 480 has_logged_autofill_enabled_ = true;
473 } 481 }
474 482
475 if (!enabled) 483 if (!enabled)
476 return; 484 return;
477 485
478 forms_loaded_timestamp_ = timestamp; 486 forms_loaded_timestamp_ = timestamp;
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 *profile_guid = IDToGUID(profile_id); 1345 *profile_guid = IDToGUID(profile_id);
1338 } 1346 }
1339 1347
1340 void AutofillManager::UpdateInitialInteractionTimestamp( 1348 void AutofillManager::UpdateInitialInteractionTimestamp(
1341 const TimeTicks& interaction_timestamp) { 1349 const TimeTicks& interaction_timestamp) {
1342 if (initial_interaction_timestamp_.is_null() || 1350 if (initial_interaction_timestamp_.is_null() ||
1343 interaction_timestamp < initial_interaction_timestamp_) { 1351 interaction_timestamp < initial_interaction_timestamp_) {
1344 initial_interaction_timestamp_ = interaction_timestamp; 1352 initial_interaction_timestamp_ = interaction_timestamp;
1345 } 1353 }
1346 } 1354 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698