diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 21:33:57 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-28 21:33:57 +0000 |
commit | cafd1d71d9685cca5d309038914dde2907fadb28 (patch) | |
tree | a0648046dfe9fefefaeb3890d77e94dacc61c1f4 | |
parent | 9eb377bd7c744ed0d471b9cd408e66c345da45c9 (diff) | |
download | chromium_src-cafd1d71d9685cca5d309038914dde2907fadb28.zip chromium_src-cafd1d71d9685cca5d309038914dde2907fadb28.tar.gz chromium_src-cafd1d71d9685cca5d309038914dde2907fadb28.tar.bz2 |
Log Autofill credit card metrics as histogram; rename metrics from AutoFill to Autofill
BUG=72758
TEST=unit_tests --gtest_filter=AutofillMetricsTest.CreditCardInfoBar
Review URL: http://codereview.chromium.org/6696101
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79616 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/autofill/autofill_cc_infobar_delegate.cc | 45 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_cc_infobar_delegate.h | 29 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_manager.cc | 26 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_manager.h | 16 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_metrics.cc | 15 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_metrics.h | 58 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_metrics_unittest.cc | 82 | ||||
-rw-r--r-- | chrome/browser/autofill/personal_data_manager.cc | 2 | ||||
-rw-r--r-- | chrome/browser/autofill/personal_data_manager.h | 2 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/infobars/infobar_controller.mm | 3 |
10 files changed, 195 insertions, 83 deletions
diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc index f02b4fd..eb835eb 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc @@ -4,23 +4,38 @@ #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" -#include "base/metrics/histogram.h" -#include "chrome/browser/autofill/autofill_manager.h" +#include "chrome/browser/autofill/credit_card.h" +#include "chrome/browser/autofill/personal_data_manager.h" #include "chrome/browser/browser_list.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -AutofillCCInfoBarDelegate::AutofillCCInfoBarDelegate(TabContents* tab_contents, - AutofillManager* host) +AutofillCCInfoBarDelegate::AutofillCCInfoBarDelegate( + TabContents* tab_contents, + const CreditCard* credit_card, + PersonalDataManager* personal_data, + const AutofillMetrics* metric_logger) : ConfirmInfoBarDelegate(tab_contents), - host_(host) { + credit_card_(credit_card), + personal_data_(personal_data), + metric_logger_(metric_logger), + had_user_interaction_(false) { + metric_logger_->Log(AutofillMetrics::CREDIT_CARD_INFOBAR_SHOWN); } AutofillCCInfoBarDelegate::~AutofillCCInfoBarDelegate() { } +void AutofillCCInfoBarDelegate::LogUserAction( + AutofillMetrics::CreditCardInfoBarMetric user_action) { + DCHECK(!had_user_interaction_); + + metric_logger_->Log(user_action); + had_user_interaction_ = true; +} + bool AutofillCCInfoBarDelegate::ShouldExpire( const NavigationController::LoadCommittedDetails& details) const { // The user has submitted a form, causing the page to navigate elsewhere. We @@ -30,13 +45,16 @@ bool AutofillCCInfoBarDelegate::ShouldExpire( } void AutofillCCInfoBarDelegate::InfoBarClosed() { - if (host_) { - host_->OnInfoBarClosed(false); - host_ = NULL; - } + if (!had_user_interaction_) + LogUserAction(AutofillMetrics::CREDIT_CARD_INFOBAR_IGNORED); + delete this; } +void AutofillCCInfoBarDelegate::InfoBarDismissed() { + LogUserAction(AutofillMetrics::CREDIT_CARD_INFOBAR_DENIED); +} + SkBitmap* AutofillCCInfoBarDelegate::GetIcon() const { return ResourceBundle::GetSharedInstance().GetBitmapNamed( IDR_INFOBAR_AUTOFILL); @@ -56,16 +74,13 @@ string16 AutofillCCInfoBarDelegate::GetButtonLabel(InfoBarButton button) const { } bool AutofillCCInfoBarDelegate::Accept() { - UMA_HISTOGRAM_COUNTS("Autofill.CCInfoBarAccepted", 1); - if (host_) { - host_->OnInfoBarClosed(true); - host_ = NULL; - } + personal_data_->SaveImportedCreditCard(*credit_card_); + LogUserAction(AutofillMetrics::CREDIT_CARD_INFOBAR_ACCEPTED); return true; } bool AutofillCCInfoBarDelegate::Cancel() { - UMA_HISTOGRAM_COUNTS("Autofill.CCInfoBarDenied", 1); + LogUserAction(AutofillMetrics::CREDIT_CARD_INFOBAR_DENIED); return true; } diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.h b/chrome/browser/autofill/autofill_cc_infobar_delegate.h index 1077458..cc59d9d 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.h +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.h @@ -7,23 +7,31 @@ #pragma once #include "base/string16.h" +#include "chrome/browser/autofill/autofill_metrics.h" #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" -class AutofillManager; +class CreditCard; +class PersonalDataManager; // An InfoBar delegate that enables the user to allow or deny storing credit // card information gathered from a form submission. class AutofillCCInfoBarDelegate : public ConfirmInfoBarDelegate { public: - AutofillCCInfoBarDelegate(TabContents* tab_contents, AutofillManager* host); + AutofillCCInfoBarDelegate(TabContents* tab_contents, + const CreditCard* credit_card, + PersonalDataManager* personal_data, + const AutofillMetrics* metric_logger); private: virtual ~AutofillCCInfoBarDelegate(); + void LogUserAction(AutofillMetrics::CreditCardInfoBarMetric user_action); + // ConfirmInfoBarDelegate: virtual bool ShouldExpire( const NavigationController::LoadCommittedDetails& details) const; virtual void InfoBarClosed(); + virtual void InfoBarDismissed(); virtual SkBitmap* GetIcon() const; virtual Type GetInfoBarType() const; virtual string16 GetMessageText() const; @@ -33,8 +41,21 @@ class AutofillCCInfoBarDelegate : public ConfirmInfoBarDelegate { virtual string16 GetLinkText(); virtual bool LinkClicked(WindowOpenDisposition disposition); - // The AutofillManager that initiated this InfoBar. - AutofillManager* host_; + // 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_; + + FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, CreditCardInfoBar); DISALLOW_COPY_AND_ASSIGN(AutofillCCInfoBarDelegate); }; diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index 719e354..1e7dd1f 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -215,8 +215,7 @@ AutofillManager::AutofillManager(TabContents* tab_contents) personal_data_(NULL), download_manager_(tab_contents->profile()), disable_download_manager_requests_(false), - metric_logger_(new AutofillMetrics), - cc_infobar_(NULL) { + metric_logger_(new AutofillMetrics) { DCHECK(tab_contents); // |personal_data_| is NULL when using TestTabContents. @@ -598,19 +597,22 @@ void AutofillManager::LogMetricsAboutSubmittedForm( } void AutofillManager::ImportFormData(const FormStructure& submitted_form) { - std::vector<const FormStructure*> import; - import.push_back(&submitted_form); + std::vector<const FormStructure*> submitted_forms; + submitted_forms.push_back(&submitted_form); const CreditCard* imported_credit_card; - if (!personal_data_->ImportFormData(import, &imported_credit_card)) + if (!personal_data_->ImportFormData(submitted_forms, &imported_credit_card)) return; // If credit card information was submitted, show an infobar to offer to save // it. + scoped_ptr<const CreditCard> scoped_credit_card(imported_credit_card); if (imported_credit_card && tab_contents()) { - imported_credit_card_.reset(imported_credit_card); - tab_contents()->AddInfoBar(new AutofillCCInfoBarDelegate(tab_contents(), - this)); + tab_contents()->AddInfoBar( + new AutofillCCInfoBarDelegate(tab_contents(), + scoped_credit_card.release(), + personal_data_, + metric_logger_.get())); } } @@ -640,19 +642,13 @@ void AutofillManager::Reset() { form_structures_.reset(); } -void AutofillManager::OnInfoBarClosed(bool should_save) { - if (should_save) - personal_data_->SaveImportedCreditCard(*imported_credit_card_); -} - AutofillManager::AutofillManager(TabContents* tab_contents, PersonalDataManager* personal_data) : TabContentsObserver(tab_contents), personal_data_(personal_data), download_manager_(NULL), disable_download_manager_requests_(true), - metric_logger_(new AutofillMetrics), - cc_infobar_(NULL) { + metric_logger_(new AutofillMetrics) { DCHECK(tab_contents); } diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h index d070b3e..be44ff1 100644 --- a/chrome/browser/autofill/autofill_manager.h +++ b/chrome/browser/autofill/autofill_manager.h @@ -50,10 +50,6 @@ class AutofillManager : public TabContentsObserver, const ViewHostMsg_FrameNavigate_Params& params); virtual bool OnMessageReceived(const IPC::Message& message); - // Called by the AutofillCCInfoBarDelegate when the user interacts with the - // infobar. - virtual void OnInfoBarClosed(bool should_save); - // AutofillDownloadManager::Observer implementation: virtual void OnLoadedAutofillHeuristics(const std::string& heuristic_xml); virtual void OnUploadedAutofillHeuristics(const std::string& form_signature); @@ -83,9 +79,7 @@ class AutofillManager : public TabContentsObserver, personal_data_ = personal_data; } - const AutofillMetrics* metric_logger() const { - return metric_logger_.get(); - } + const AutofillMetrics* metric_logger() const { return metric_logger_.get(); } void set_metric_logger(const AutofillMetrics* metric_logger); ScopedVector<FormStructure>* form_structures() { return &form_structures_; } @@ -206,14 +200,6 @@ class AutofillManager : public TabContentsObserver, // Our copy of the form data. ScopedVector<FormStructure> form_structures_; - // The InfoBar that asks for permission to store credit card information. - // Deletes itself when closed. - AutofillCCInfoBarDelegate* cc_infobar_; - - // The imported credit card that should be saved if the user accepts the - // infobar. - scoped_ptr<const CreditCard> imported_credit_card_; - // GUID to ID mapping. We keep two maps to convert back and forth. std::map<std::string, int> guid_id_map_; std::map<int, std::string> id_guid_map_; diff --git a/chrome/browser/autofill/autofill_metrics.cc b/chrome/browser/autofill/autofill_metrics.cc index bf6adfd..8d9adbb 100644 --- a/chrome/browser/autofill/autofill_metrics.cc +++ b/chrome/browser/autofill/autofill_metrics.cc @@ -12,10 +12,17 @@ AutofillMetrics::AutofillMetrics() { AutofillMetrics::~AutofillMetrics() { } +void AutofillMetrics::Log(CreditCardInfoBarMetric metric) const { + DCHECK(metric < NUM_CREDIT_CARD_INFO_BAR_METRICS); + + UMA_HISTOGRAM_ENUMERATION("Autofill.CreditCardInfoBar", metric, + NUM_CREDIT_CARD_INFO_BAR_METRICS); +} + void AutofillMetrics::Log(ServerQueryMetric metric) const { DCHECK(metric < NUM_SERVER_QUERY_METRICS); - UMA_HISTOGRAM_ENUMERATION("AutoFill.ServerQueryResponse", metric, + UMA_HISTOGRAM_ENUMERATION("Autofill.ServerQueryResponse", metric, NUM_SERVER_QUERY_METRICS); } @@ -23,13 +30,13 @@ void AutofillMetrics::Log(QualityMetric metric, const std::string& experiment_id) const { DCHECK(metric < NUM_QUALITY_METRICS); - std::string histogram_name = "AutoFill.Quality"; + std::string histogram_name = "Autofill.Quality"; if (!experiment_id.empty()) histogram_name += "_" + experiment_id; UMA_HISTOGRAM_ENUMERATION(histogram_name, metric, NUM_QUALITY_METRICS); } -void AutofillMetrics::LogProfileCount(size_t num_profiles) const { - UMA_HISTOGRAM_COUNTS("AutoFill.ProfileCount", num_profiles); +void AutofillMetrics::LogStoredProfileCount(size_t num_profiles) const { + UMA_HISTOGRAM_COUNTS("Autofill.StoredProfileCount", num_profiles); } diff --git a/chrome/browser/autofill/autofill_metrics.h b/chrome/browser/autofill/autofill_metrics.h index 8251e75..a6b0b8a 100644 --- a/chrome/browser/autofill/autofill_metrics.h +++ b/chrome/browser/autofill/autofill_metrics.h @@ -12,26 +12,17 @@ class AutofillMetrics { public: - // Each of these is logged at most once per query to the server, which in turn - // occurs at most once per page load. - enum ServerQueryMetric { - // Logged for each query sent to the server. - QUERY_SENT = 0, - // Logged for each query response received from the server. - QUERY_RESPONSE_RECEIVED, - // Logged for each parsable response received from the server. - QUERY_RESPONSE_PARSED, - // Logged for each parsable response that provided no improvements relative - // to our heuristics. - QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, - // Logged for each page for which our heuristics detected at least one - // auto-fillable field, but the server response overrode the type of at - // least one field. - QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, - // Logged for each page for which our heuristics did not detect any - // auto-fillable fields, but the server response did detect some. - QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, - NUM_SERVER_QUERY_METRICS + // Each of these is logged at most once per form submission. + enum CreditCardInfoBarMetric { + // Logged when we show an infobar prompting to save credit card info. + CREDIT_CARD_INFOBAR_SHOWN = 0, + // Logged when the user explicitly accepts the infobar. + CREDIT_CARD_INFOBAR_ACCEPTED, + // Logged when the user explicitly denies the infobar. + CREDIT_CARD_INFOBAR_DENIED, + // Logged when the user completely ignores the infobar (on tab close). + CREDIT_CARD_INFOBAR_IGNORED, + NUM_CREDIT_CARD_INFO_BAR_METRICS }; // Each of these is logged at most once per form submission. @@ -57,15 +48,38 @@ class AutofillMetrics { NUM_QUALITY_METRICS }; + // Each of these is logged at most once per query to the server, which in turn + // occurs at most once per page load. + enum ServerQueryMetric { + // Logged for each query sent to the server. + QUERY_SENT = 0, + // Logged for each query response received from the server. + QUERY_RESPONSE_RECEIVED, + // Logged for each parsable response received from the server. + QUERY_RESPONSE_PARSED, + // Logged for each parsable response that provided no improvements relative + // to our heuristics. + QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, + // Logged for each page for which our heuristics detected at least one + // auto-fillable field, but the server response overrode the type of at + // least one field. + QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, + // Logged for each page for which our heuristics did not detect any + // auto-fillable fields, but the server response did detect some. + QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, + NUM_SERVER_QUERY_METRICS + }; + AutofillMetrics(); virtual ~AutofillMetrics(); - virtual void Log(ServerQueryMetric metric) const; + virtual void Log(CreditCardInfoBarMetric metric) const; virtual void Log(QualityMetric metric, const std::string& experiment_id) const; + virtual void Log(ServerQueryMetric metric) const; // This should be called at most once per run. - virtual void LogProfileCount(size_t num_profiles) const; + virtual void LogStoredProfileCount(size_t num_profiles) const; private: DISALLOW_COPY_AND_ASSIGN(AutofillMetrics); diff --git a/chrome/browser/autofill/autofill_metrics_unittest.cc b/chrome/browser/autofill/autofill_metrics_unittest.cc index f17887c..698c55d 100644 --- a/chrome/browser/autofill/autofill_metrics_unittest.cc +++ b/chrome/browser/autofill/autofill_metrics_unittest.cc @@ -8,6 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "base/string16.h" #include "base/utf_string_conversions.h" +#include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" #include "chrome/browser/autofill/autofill_common_test.h" #include "chrome/browser/autofill/autofill_manager.h" #include "chrome/browser/autofill/autofill_metrics.h" @@ -28,16 +29,16 @@ namespace { class MockAutofillMetrics : public AutofillMetrics { public: MockAutofillMetrics() {} - MOCK_CONST_METHOD1(Log, void(ServerQueryMetric metric)); + MOCK_CONST_METHOD1(Log, void(CreditCardInfoBarMetric metric)); MOCK_CONST_METHOD2(Log, void(QualityMetric metric, const std::string& experiment_id)); - MOCK_CONST_METHOD1(LogProfileCount, void(size_t num_profiles)); + MOCK_CONST_METHOD1(Log, void(ServerQueryMetric metric)); + MOCK_CONST_METHOD1(LogStoredProfileCount, void(size_t num_profiles)); private: DISALLOW_COPY_AND_ASSIGN(MockAutofillMetrics); }; -// TODO(isherman): Move this into autofill_common_test.h? class TestPersonalDataManager : public PersonalDataManager { public: TestPersonalDataManager() { @@ -71,6 +72,9 @@ class TestPersonalDataManager : public PersonalDataManager { PersonalDataManager::set_has_logged_profile_count(false); } + MOCK_METHOD1(SaveImportedCreditCard, + void(const CreditCard& imported_credit_card)); + private: void CreateTestAutofillProfiles(ScopedVector<AutofillProfile>* profiles) { AutofillProfile* profile = new AutofillProfile; @@ -564,16 +568,82 @@ TEST_F(AutofillMetricsTest, QualityMetricsWithExperimentId) { } // Test that the profile count is logged correctly. -TEST_F(AutofillMetricsTest, ProfileCount) { +TEST_F(AutofillMetricsTest, StoredProfileCount) { TestPersonalDataManager::ResetHasLoggedProfileCount(); // The metric should be logged when the profiles are first loaded. EXPECT_CALL(*test_personal_data_->metric_logger(), - LogProfileCount(3)).Times(1); + LogStoredProfileCount(3)).Times(1); test_personal_data_->LoadProfiles(); // The metric should only be logged once. EXPECT_CALL(*test_personal_data_->metric_logger(), - LogProfileCount(::testing::_)).Times(0); + LogStoredProfileCount(::testing::_)).Times(0); test_personal_data_->LoadProfiles(); } + +// Test that credit card infobar metrics are logged correctly. +TEST_F(AutofillMetricsTest, CreditCardInfoBar) { + MockAutofillMetrics metric_logger; + CreditCard* credit_card; + AutofillCCInfoBarDelegate* infobar; + ::testing::InSequence dummy; + + // Accept the infobar. + EXPECT_CALL(metric_logger, Log(AutofillMetrics::CREDIT_CARD_INFOBAR_SHOWN)); + credit_card = new CreditCard(); + infobar = new AutofillCCInfoBarDelegate(contents(), + credit_card, + test_personal_data_.get(), + &metric_logger); + + EXPECT_CALL(*test_personal_data_.get(), SaveImportedCreditCard(*credit_card)); + EXPECT_CALL(metric_logger, + Log(AutofillMetrics::CREDIT_CARD_INFOBAR_ACCEPTED)).Times(1); + EXPECT_CALL(metric_logger, + Log(AutofillMetrics::CREDIT_CARD_INFOBAR_IGNORED)).Times(0); + EXPECT_TRUE(infobar->Accept()); + infobar->InfoBarClosed(); + + // Cancel the infobar. + EXPECT_CALL(metric_logger, Log(AutofillMetrics::CREDIT_CARD_INFOBAR_SHOWN)); + credit_card = new CreditCard(); + infobar = new AutofillCCInfoBarDelegate(contents(), + credit_card, + test_personal_data_.get(), + &metric_logger); + + EXPECT_CALL(metric_logger, + Log(AutofillMetrics::CREDIT_CARD_INFOBAR_DENIED)).Times(1); + EXPECT_CALL(metric_logger, + Log(AutofillMetrics::CREDIT_CARD_INFOBAR_IGNORED)).Times(0); + EXPECT_TRUE(infobar->Cancel()); + infobar->InfoBarClosed(); + + // Dismiss the infobar. + EXPECT_CALL(metric_logger, Log(AutofillMetrics::CREDIT_CARD_INFOBAR_SHOWN)); + credit_card = new CreditCard(); + infobar = new AutofillCCInfoBarDelegate(contents(), + credit_card, + test_personal_data_.get(), + &metric_logger); + + EXPECT_CALL(metric_logger, + Log(AutofillMetrics::CREDIT_CARD_INFOBAR_DENIED)).Times(1); + EXPECT_CALL(metric_logger, + Log(AutofillMetrics::CREDIT_CARD_INFOBAR_IGNORED)).Times(0); + infobar->InfoBarDismissed(); + infobar->InfoBarClosed(); + + // Ignore the infobar. + EXPECT_CALL(metric_logger, Log(AutofillMetrics::CREDIT_CARD_INFOBAR_SHOWN)); + credit_card = new CreditCard(); + infobar = new AutofillCCInfoBarDelegate(contents(), + credit_card, + test_personal_data_.get(), + &metric_logger); + + EXPECT_CALL(metric_logger, + Log(AutofillMetrics::CREDIT_CARD_INFOBAR_IGNORED)).Times(1); + infobar->InfoBarClosed(); +} diff --git a/chrome/browser/autofill/personal_data_manager.cc b/chrome/browser/autofill/personal_data_manager.cc index 6f04182..e652137 100644 --- a/chrome/browser/autofill/personal_data_manager.cc +++ b/chrome/browser/autofill/personal_data_manager.cc @@ -894,7 +894,7 @@ void PersonalDataManager::EmptyMigrationTrash() { void PersonalDataManager::LogProfileCount() const { if (!g_has_logged_profile_count) { g_has_logged_profile_count = true; - metric_logger_->LogProfileCount(web_profiles_.size()); + metric_logger_->LogStoredProfileCount(web_profiles_.size()); } } diff --git a/chrome/browser/autofill/personal_data_manager.h b/chrome/browser/autofill/personal_data_manager.h index 5d74575..890dfd4 100644 --- a/chrome/browser/autofill/personal_data_manager.h +++ b/chrome/browser/autofill/personal_data_manager.h @@ -72,7 +72,7 @@ class PersonalDataManager const CreditCard** credit_card); // Saves a credit card value detected in |ImportedFormData|. - void SaveImportedCreditCard(const CreditCard& imported_credit_card); + virtual void SaveImportedCreditCard(const CreditCard& imported_credit_card); // Sets |web_profiles_| to the contents of |profiles| and updates the web // database by adding, updating and removing profiles. diff --git a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm index 0c9967a..d536833 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_controller.mm @@ -152,6 +152,9 @@ const float kAnimateCloseDuration = 0.12; // Called when someone clicks on the close button. - (void)dismiss:(id)sender { + if (delegate_) + delegate_->InfoBarDismissed(); + [self removeInfoBar]; } |