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

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

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 "chrome/browser/autofill/autofill_manager.h" 5 #include "chrome/browser/autofill/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 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 862
863 void AutofillManager::ImportFormData(const FormStructure& submitted_form) { 863 void AutofillManager::ImportFormData(const FormStructure& submitted_form) {
864 const CreditCard* imported_credit_card; 864 const CreditCard* imported_credit_card;
865 if (!personal_data_->ImportFormData(submitted_form, &imported_credit_card)) 865 if (!personal_data_->ImportFormData(submitted_form, &imported_credit_card))
866 return; 866 return;
867 867
868 // If credit card information was submitted, show an infobar to offer to save 868 // If credit card information was submitted, show an infobar to offer to save
869 // it. 869 // it.
870 scoped_ptr<const CreditCard> scoped_credit_card(imported_credit_card); 870 scoped_ptr<const CreditCard> scoped_credit_card(imported_credit_card);
871 if (imported_credit_card && web_contents()) { 871 if (imported_credit_card && web_contents()) {
872 InfoBarService* infobar_service = manager_delegate_->GetInfoBarService(); 872 AutofillCCInfoBarDelegate::Create(manager_delegate_->GetInfoBarService(),
873 infobar_service->AddInfoBar( 873 scoped_credit_card.release(), personal_data_, metric_logger_.get());
874 new AutofillCCInfoBarDelegate(infobar_service,
875 scoped_credit_card.release(),
876 personal_data_,
877 metric_logger_.get()));
878 } 874 }
879 } 875 }
880 876
881 // Note that |submitted_form| is passed as a pointer rather than as a reference 877 // Note that |submitted_form| is passed as a pointer rather than as a reference
882 // so that we can get memory management right across threads. Note also that we 878 // so that we can get memory management right across threads. Note also that we
883 // explicitly pass in all the time stamps of interest, as the cached ones might 879 // explicitly pass in all the time stamps of interest, as the cached ones might
884 // get reset before this method executes. 880 // get reset before this method executes.
885 void AutofillManager::UploadFormDataAsyncCallback( 881 void AutofillManager::UploadFormDataAsyncCallback(
886 const FormStructure* submitted_form, 882 const FormStructure* submitted_form,
887 const TimeTicks& load_time, 883 const TimeTicks& load_time,
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 *profile_guid = IDToGUID(profile_id); 1277 *profile_guid = IDToGUID(profile_id);
1282 } 1278 }
1283 1279
1284 void AutofillManager::UpdateInitialInteractionTimestamp( 1280 void AutofillManager::UpdateInitialInteractionTimestamp(
1285 const TimeTicks& interaction_timestamp) { 1281 const TimeTicks& interaction_timestamp) {
1286 if (initial_interaction_timestamp_.is_null() || 1282 if (initial_interaction_timestamp_.is_null() ||
1287 interaction_timestamp < initial_interaction_timestamp_) { 1283 interaction_timestamp < initial_interaction_timestamp_) {
1288 initial_interaction_timestamp_ = interaction_timestamp; 1284 initial_interaction_timestamp_ = interaction_timestamp;
1289 } 1285 }
1290 } 1286 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_cc_infobar_delegate.cc ('k') | chrome/browser/autofill/autofill_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698