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

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

Issue 1128073003: [Smart Lock] Make link from brading string (Google Smart Lock) in save password infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
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 4bd731731caf977db4ad174fe75e6b734e84bfde..7e2f2d84c221a4b712f79f650ee5381a70f041f9 100644
--- a/chrome/browser/password_manager/save_password_infobar_delegate.cc
+++ b/chrome/browser/password_manager/save_password_infobar_delegate.cc
@@ -98,11 +98,18 @@ SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate(
"PasswordManager.SavePasswordPromptDisplayed_" + uma_histogram_suffix_,
true);
}
- int brand_string_id = is_smartlock_branding_enabled
- ? IDS_PASSWORD_MANAGER_SMART_LOCK
- : IDS_SAVE_PASSWORD_TITLE_BRAND;
- title_ = l10n_util::GetStringFUTF16(
- IDS_SAVE_PASSWORD, l10n_util::GetStringUTF16(brand_string_id));
+ title_link_range_ = gfx::Range();
+ if (is_smartlock_branding_enabled) {
+ size_t offset = 0;
+ base::string16 title_link =
+ l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK);
+ title_ = l10n_util::GetStringFUTF16(IDS_SAVE_PASSWORD, title_link, &offset);
+ title_link_range_ = gfx::Range(offset, offset + title_link.length());
+ } else {
+ title_ = l10n_util::GetStringFUTF16(
+ IDS_SAVE_PASSWORD,
+ l10n_util::GetStringUTF16(IDS_SAVE_PASSWORD_TITLE_BRAND));
+ }
}
bool SavePasswordInfoBarDelegate::ShouldShowMoreButton() {
@@ -164,3 +171,15 @@ 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_ARTICLE)),
+ content::Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ ui::PAGE_TRANSITION_LINK, false));
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698