| 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..9bc95c275ad849f2d91c82dc8bb35c57bcc7a43e 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,19 +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_;
|
| -
|
| - // Did the user ever explicitly accept or dismiss this infobar?
|
| - bool had_user_interaction_;
|
| + scoped_ptr<autofill::AutofillCCImportConfirmationDelegate> delegate_;
|
|
|
| FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardInfoBar);
|
|
|
|
|