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 608688a59e3afb590a672210bd398496533ae82a..10d9aa9600d4abfa69b871b0175aa2fbc2a621aa 100644 |
--- a/chrome/browser/password_manager/save_password_infobar_delegate.cc |
+++ b/chrome/browser/password_manager/save_password_infobar_delegate.cc |
@@ -9,6 +9,7 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/sync/profile_sync_service.h" |
#include "chrome/browser/sync/profile_sync_service_factory.h" |
+#include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
#include "chrome/grit/chromium_strings.h" |
#include "chrome/grit/generated_resources.h" |
#include "components/infobars/core/infobar.h" |
@@ -51,7 +52,7 @@ void SavePasswordInfoBarDelegate::Create( |
ProfileSyncServiceFactory::GetForProfile(profile); |
SavePasswordInfoBarDelegate* infobar_delegate = |
new SavePasswordInfoBarDelegate( |
- form_to_save.Pass(), uma_histogram_suffix, source_type, |
+ web_contents, form_to_save.Pass(), uma_histogram_suffix, source_type, |
password_bubble_experiment::IsSmartLockBrandingEnabled(sync_service)); |
#if defined(OS_ANDROID) |
// For Android in case of smart lock we need different appearance of infobar. |
@@ -95,6 +96,7 @@ SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() { |
} |
SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate( |
+ content::WebContents* web_contents, |
scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
const std::string& uma_histogram_suffix, |
password_manager::CredentialSourceType source_type, |
@@ -110,17 +112,9 @@ SavePasswordInfoBarDelegate::SavePasswordInfoBarDelegate( |
true); |
} |
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)); |
- } |
+ GetSavePasswordTitleTextAndLinkRange( |
+ web_contents, form_to_save->observed_form().origin, |
+ is_smartlock_branding_enabled, &title_, &title_link_range_); |
} |
bool SavePasswordInfoBarDelegate::ShouldShowMoreButton() { |