Commit a14f7ec4 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

Add FromInfobarDelegate API to AutofillSaveCardInfoBarDelegateMobile

Bug: 1071914
Change-Id: Ieb1c78e1c6a771672c84ae7011ad7bf4815655c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2236597
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarJared Saul <jsaul@google.com>
Cr-Commit-Position: refs/heads/master@{#776355}
parent c7dca4cc
...@@ -72,6 +72,15 @@ AutofillSaveCardInfoBarDelegateMobile:: ...@@ -72,6 +72,15 @@ AutofillSaveCardInfoBarDelegateMobile::
} }
} }
// static
AutofillSaveCardInfoBarDelegateMobile*
AutofillSaveCardInfoBarDelegateMobile::FromInfobarDelegate(
infobars::InfoBarDelegate* delegate) {
return delegate->GetIdentifier() == AUTOFILL_CC_INFOBAR_DELEGATE_MOBILE
? static_cast<AutofillSaveCardInfoBarDelegateMobile*>(delegate)
: nullptr;
}
void AutofillSaveCardInfoBarDelegateMobile::OnLegalMessageLinkClicked( void AutofillSaveCardInfoBarDelegateMobile::OnLegalMessageLinkClicked(
GURL url) { GURL url) {
infobar()->owner()->OpenURL(url, WindowOpenDisposition::NEW_FOREGROUND_TAB); infobar()->owner()->OpenURL(url, WindowOpenDisposition::NEW_FOREGROUND_TAB);
......
...@@ -39,6 +39,11 @@ class AutofillSaveCardInfoBarDelegateMobile : public ConfirmInfoBarDelegate { ...@@ -39,6 +39,11 @@ class AutofillSaveCardInfoBarDelegateMobile : public ConfirmInfoBarDelegate {
~AutofillSaveCardInfoBarDelegateMobile() override; ~AutofillSaveCardInfoBarDelegateMobile() override;
// Returns |delegate| as an AutofillSaveCardInfoBarDelegateMobile, or nullptr
// if it is of another type.
static AutofillSaveCardInfoBarDelegateMobile* FromInfobarDelegate(
infobars::InfoBarDelegate* delegate);
bool upload() const { return upload_; } bool upload() const { return upload_; }
int issuer_icon_id() const { return issuer_icon_id_; } int issuer_icon_id() const { return issuer_icon_id_; }
const base::string16& card_label() const { return card_label_; } const base::string16& card_label() const { return card_label_; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment