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..03ca6b346341f3b9ad82ef7ccb3f9cb6ee3cea60 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,20 @@ 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) |
| + // Only for unit tests. |
|
Ilya Sherman
2013/03/05 04:37:39
Why did you remove the #if defined(UNIT_TEST)? Pr
kaiwang
2013/03/05 18:38:16
Using the ifdef, the function implementation has t
|
| 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)); |
| - } |
| -#endif |
| + scoped_ptr<autofill::AutofillCCImportConfirmationDelegate> delegate); |
| 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 +52,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); |