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

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

Issue 1181623004: [Password Manager] Replace "this site" in save password prompt with password's origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just a code rebase. Created 5 years, 6 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 608688a59e3afb590a672210bd398496533ae82a..f0db8b393944469bc7783790465efe6864913488 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"
@@ -110,17 +111,10 @@ 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));
- }
+ GetSavePasswordDialogTitleTextAndLinkRange(
+ form_to_save_->client()->GetMainFrameURL(),
+ form_to_save_->observed_form().origin, is_smartlock_branding_enabled,
+ &title_, &title_link_range_);
}
bool SavePasswordInfoBarDelegate::ShouldShowMoreButton() {

Powered by Google App Engine
This is Rietveld 408576698