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

Side by Side Diff: components/autofill/core/browser/autofill_cc_infobar_delegate.cc

Issue 922953002: Minor infobar cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 5 years, 10 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
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 "components/autofill/core/browser/autofill_cc_infobar_delegate.h" 5 #include "components/autofill/core/browser/autofill_cc_infobar_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "components/autofill/core/browser/autofill_client.h" 8 #include "components/autofill/core/browser/autofill_client.h"
9 #include "components/autofill/core/browser/credit_card.h" 9 #include "components/autofill/core/browser/credit_card.h"
10 #include "components/autofill/core/browser/personal_data_manager.h" 10 #include "components/autofill/core/browser/personal_data_manager.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 DCHECK(!had_user_interaction_); 48 DCHECK(!had_user_interaction_);
49 49
50 AutofillMetrics::LogCreditCardInfoBarMetric(user_action); 50 AutofillMetrics::LogCreditCardInfoBarMetric(user_action);
51 had_user_interaction_ = true; 51 had_user_interaction_ = true;
52 } 52 }
53 53
54 void AutofillCCInfoBarDelegate::InfoBarDismissed() { 54 void AutofillCCInfoBarDelegate::InfoBarDismissed() {
55 LogUserAction(AutofillMetrics::INFOBAR_DENIED); 55 LogUserAction(AutofillMetrics::INFOBAR_DENIED);
56 } 56 }
57 57
58 int AutofillCCInfoBarDelegate::GetIconID() const { 58 infobars::InfoBarDelegate::Type
59 return IDR_INFOBAR_AUTOFILL_CC; 59 AutofillCCInfoBarDelegate::GetInfoBarType() const {
60 }
61
62 infobars::InfoBarDelegate::Type AutofillCCInfoBarDelegate::GetInfoBarType()
63 const {
64 return PAGE_ACTION_TYPE; 60 return PAGE_ACTION_TYPE;
65 } 61 }
66 62
67 bool AutofillCCInfoBarDelegate::ShouldExpireInternal( 63 bool AutofillCCInfoBarDelegate::ShouldExpireInternal(
68 const NavigationDetails& details) const { 64 const NavigationDetails& details) const {
69 // The user has submitted a form, causing the page to navigate elsewhere. We 65 // The user has submitted a form, causing the page to navigate elsewhere. We
70 // don't want the infobar to be expired at this point, because the user won't 66 // don't want the infobar to be expired at this point, because the user won't
71 // get a chance to answer the question. 67 // get a chance to answer the question.
72 return false; 68 return false;
73 } 69 }
74 70
71 int AutofillCCInfoBarDelegate::GetIconID() const {
72 return IDR_INFOBAR_AUTOFILL_CC;
73 }
74
75 base::string16 AutofillCCInfoBarDelegate::GetMessageText() const { 75 base::string16 AutofillCCInfoBarDelegate::GetMessageText() const {
76 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_INFOBAR_TEXT); 76 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_INFOBAR_TEXT);
77 } 77 }
78 78
79 base::string16 AutofillCCInfoBarDelegate::GetButtonLabel( 79 base::string16 AutofillCCInfoBarDelegate::GetButtonLabel(
80 InfoBarButton button) const { 80 InfoBarButton button) const {
81 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? 81 return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
82 IDS_AUTOFILL_CC_INFOBAR_ACCEPT : IDS_AUTOFILL_CC_INFOBAR_DENY); 82 IDS_AUTOFILL_CC_INFOBAR_ACCEPT : IDS_AUTOFILL_CC_INFOBAR_DENY);
83 } 83 }
84 84
(...skipping 15 matching lines...) Expand all
100 100
101 bool AutofillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { 101 bool AutofillCCInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
102 autofill_client_->LinkClicked( 102 autofill_client_->LinkClicked(
103 GURL(autofill::kHelpURL), 103 GURL(autofill::kHelpURL),
104 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition); 104 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition);
105 105
106 return false; 106 return false;
107 } 107 }
108 108
109 } // namespace autofill 109 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698