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

Unified Diff: chrome/browser/password_manager/save_password_infobar_delegate.cc

Issue 1313363004: [Password Manager] Extract some methods of SavePasswordInfobarDelegate to separate class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/password_manager/save_password_infobar_delegate.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/save_password_infobar_delegate.cc
diff --git a/chrome/browser/password_manager/save_password_infobar_delegate.cc b/chrome/browser/password_manager/save_password_infobar_delegate.cc
index e3094ed836cbf571efc3ce9fa86d56f105eda2c2..3841aed22c45fca80f18ca2bbedb9ef28001864e 100644
--- a/chrome/browser/password_manager/save_password_infobar_delegate.cc
+++ b/chrome/browser/password_manager/save_password_infobar_delegate.cc
@@ -91,7 +91,7 @@ SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate(
password_manager::CredentialSourceType source_type,
bool is_smartlock_branding_enabled,
bool should_show_first_run_experience)
- : ConfirmInfoBarDelegate(),
+ : PasswordManagerInfoBarDelegate(),
form_to_save_(form_to_save.Pass()),
infobar_response_(password_manager::metrics_util::NO_RESPONSE),
uma_histogram_suffix_(uma_histogram_suffix),
@@ -103,10 +103,13 @@ SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate(
"PasswordManager.SavePasswordPromptDisplayed_" + uma_histogram_suffix_,
true);
}
- message_link_range_ = gfx::Range();
+ base::string16 message;
+ gfx::Range message_link_range = gfx::Range();
GetSavePasswordDialogTitleTextAndLinkRange(
web_contents->GetVisibleURL(), form_to_save_->observed_form().origin,
- is_smartlock_branding_enabled, false, &message_, &message_link_range_);
+ is_smartlock_branding_enabled, false, &message, &message_link_range);
+ SetMessage(message);
+ SetMessageLinkRange(message_link_range);
}
base::string16 SavePasswordInfoBarDelegate::GetFirstRunExperienceMessage() {
@@ -116,34 +119,11 @@ base::string16 SavePasswordInfoBarDelegate::GetFirstRunExperienceMessage() {
: base::string16();
}
-infobars::InfoBarDelegate::Type
-SavePasswordInfoBarDelegate::GetInfoBarType() const {
- return PAGE_ACTION_TYPE;
-}
-
-infobars::InfoBarDelegate::InfoBarAutomationType
-SavePasswordInfoBarDelegate::GetInfoBarAutomationType() const {
- return PASSWORD_INFOBAR;
-}
-
-int SavePasswordInfoBarDelegate::GetIconId() const {
- return IDR_INFOBAR_SAVE_PASSWORD;
-}
-
-bool SavePasswordInfoBarDelegate::ShouldExpire(
- const NavigationDetails& details) const {
- return !details.is_redirect && ConfirmInfoBarDelegate::ShouldExpire(details);
-}
-
void SavePasswordInfoBarDelegate::InfoBarDismissed() {
DCHECK(form_to_save_.get());
infobar_response_ = password_manager::metrics_util::INFOBAR_DISMISSED;
}
-base::string16 SavePasswordInfoBarDelegate::GetMessageText() const {
- return message_;
-}
-
base::string16 SavePasswordInfoBarDelegate::GetButtonLabel(
InfoBarButton button) const {
return l10n_util::GetStringUTF16((button == BUTTON_OK)
@@ -169,15 +149,3 @@ bool SavePasswordInfoBarDelegate::Cancel() {
}
return true;
}
-
-bool SavePasswordInfoBarDelegate::LinkClicked(
- WindowOpenDisposition disposition) {
- InfoBarService::WebContentsFromInfoBar(infobar())
- ->OpenURL(content::OpenURLParams(
- GURL(l10n_util::GetStringUTF16(
- IDS_PASSWORD_MANAGER_SMART_LOCK_PAGE)),
- content::Referrer(),
- (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- ui::PAGE_TRANSITION_LINK, false));
- return true;
-}
« no previous file with comments | « chrome/browser/password_manager/save_password_infobar_delegate.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698