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

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

Issue 1142153002: Simplify infobar expiry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android compile Created 5 years, 7 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 infobars::InfoBarDelegate::Type 54 infobars::InfoBarDelegate::Type
55 AutofillCCInfoBarDelegate::GetInfoBarType() const { 55 AutofillCCInfoBarDelegate::GetInfoBarType() const {
56 return PAGE_ACTION_TYPE; 56 return PAGE_ACTION_TYPE;
57 } 57 }
58 58
59 int AutofillCCInfoBarDelegate::GetIconID() const { 59 int AutofillCCInfoBarDelegate::GetIconID() const {
60 return IDR_INFOBAR_AUTOFILL_CC; 60 return IDR_INFOBAR_AUTOFILL_CC;
61 } 61 }
62 62
63 void AutofillCCInfoBarDelegate::InfoBarDismissed() { 63 bool AutofillCCInfoBarDelegate::ShouldExpire(
64 LogUserAction(AutofillMetrics::INFOBAR_DENIED);
65 }
66
67 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 void AutofillCCInfoBarDelegate::InfoBarDismissed() {
72 LogUserAction(AutofillMetrics::INFOBAR_DENIED);
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