Chromium Code Reviews| Index: chrome/browser/autofill/autofill_cc_infobar_delegate.h |
| diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.h b/chrome/browser/autofill/autofill_cc_infobar_delegate.h |
| index 8e1e3f5daea3d8b6e18d433c0fb690968d44afd8..370feffcf22dff2a218bb974a9007637487f5324 100644 |
| --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.h |
| +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.h |
| @@ -10,11 +10,11 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/string16.h" |
| #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| -#include "chrome/browser/autofill/autofill_metrics.h" |
| #include "ui/base/window_open_disposition.h" |
| -class CreditCard; |
| -class PersonalDataManager; |
| +namespace autofill { |
| +class AutofillCCImportConfirmationDelegate; |
| +} |
| namespace content { |
| struct LoadCommittedDetails; |
| @@ -25,30 +25,24 @@ struct LoadCommittedDetails; |
| class AutofillCCInfoBarDelegate : public ConfirmInfoBarDelegate { |
| public: |
| // Creates an autofill credit card delegate and adds it to |infobar_service|. |
| - static void Create(InfoBarService* infobar_service, |
| - const CreditCard* credit_card, |
| - PersonalDataManager* personal_data, |
| - const AutofillMetrics* metric_logger); |
| + static void Create( |
| + InfoBarService* infobar_service, |
| + scoped_ptr<autofill::AutofillCCImportConfirmationDelegate> delegate); |
| #if defined(UNIT_TEST) |
| static scoped_ptr<ConfirmInfoBarDelegate> Create( |
| - const CreditCard* credit_card, |
| - PersonalDataManager* personal_data, |
| - const AutofillMetrics* metric_logger) { |
| - return scoped_ptr<ConfirmInfoBarDelegate>(new AutofillCCInfoBarDelegate( |
| - NULL, credit_card, personal_data, metric_logger)); |
| + scoped_ptr<autofill::AutofillCCImportConfirmationDelegate> delegate) { |
| + return scoped_ptr<ConfirmInfoBarDelegate>( |
| + new AutofillCCInfoBarDelegate(NULL, delegate.Pass())); |
| } |
| #endif |
| private: |
| - AutofillCCInfoBarDelegate(InfoBarService* infobar_service, |
| - const CreditCard* credit_card, |
| - PersonalDataManager* personal_data, |
| - const AutofillMetrics* metric_logger); |
| + AutofillCCInfoBarDelegate( |
| + InfoBarService* infobar_service, |
| + scoped_ptr<autofill::AutofillCCImportConfirmationDelegate> delegate); |
| virtual ~AutofillCCInfoBarDelegate(); |
| - void LogUserAction(AutofillMetrics::InfoBarMetric user_action); |
| - |
| // ConfirmInfoBarDelegate: |
| virtual void InfoBarDismissed() OVERRIDE; |
| virtual gfx::Image* GetIcon() const OVERRIDE; |
| @@ -62,16 +56,7 @@ class AutofillCCInfoBarDelegate : public ConfirmInfoBarDelegate { |
| virtual string16 GetLinkText() const OVERRIDE; |
| virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE; |
| - // The credit card that should be saved if the user accepts the infobar. |
| - scoped_ptr<const CreditCard> credit_card_; |
| - |
| - // The personal data manager to which the credit card should be saved. |
| - // Weak reference. |
| - PersonalDataManager* personal_data_; |
| - |
| - // For logging UMA metrics. |
| - // Weak reference. Owned by the AutofillManager that initiated this infobar. |
| - const AutofillMetrics* metric_logger_; |
| + scoped_ptr<autofill::AutofillCCImportConfirmationDelegate> delegate_; |
| // Did the user ever explicitly accept or dismiss this infobar? |
| bool had_user_interaction_; |
|
Ilya Sherman
2013/03/04 21:07:34
IMO you should move this into the delegate as well
kaiwang
2013/03/05 01:48:56
Done.
|