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

Unified Diff: chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc

Issue 1138523005: [Smart Lock] Update password generation prompt to conditionally use new branding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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/ui/autofill/password_generation_popup_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
index 26a3649ee621f68aa309a8621e11903f04d3233d..5ee343e6c65441c0083a2153b5131156ac10646e 100644
--- a/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/password_generation_popup_controller_impl.cc
@@ -11,11 +11,13 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversion_utils.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/autofill/password_generation_popup_observer.h"
#include "chrome/browser/ui/autofill/password_generation_popup_view.h"
#include "chrome/browser/ui/autofill/popup_constants.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/passwords/password_bubble_experiment.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
@@ -87,15 +89,18 @@ PasswordGenerationPopupControllerImpl::PasswordGenerationPopupControllerImpl(
base::Bind(&PasswordGenerationPopupControllerImpl::HandleKeyPressEvent,
base::Unretained(this)));
- std::vector<base::string16> pieces;
- base::SplitStringDontTrim(
- l10n_util::GetStringUTF16(IDS_PASSWORD_GENERATION_PROMPT),
- '|', // separator
- &pieces);
- DCHECK_EQ(3u, pieces.size());
- link_range_ = gfx::Range(pieces[0].size(),
- pieces[0].size() + pieces[1].size());
- help_text_ = JoinString(pieces, base::string16());
+ int link_id = IDS_MANAGE_PASSWORDS_LINK;
+ int help_text_id = IDS_PASSWORD_GENERATION_PROMPT;
+ if (password_bubble_experiment::IsSmartLockBrandingEnabled(
+ Profile::FromBrowserContext(web_contents->GetBrowserContext()))) {
+ help_text_id = IDS_PASSWORD_GENERATION_SMART_LOCK_PROMPT;
+ link_id = IDS_PASSWORD_MANAGER_SMART_LOCK_FOR_PASSWORDS;
+ }
+
+ base::string16 link = l10n_util::GetStringUTF16(link_id);
+ size_t offset;
+ help_text_ = l10n_util::GetStringFUTF16(help_text_id, link, &offset);
+ link_range_ = gfx::Range(offset, offset + link.length());
}
PasswordGenerationPopupControllerImpl::~PasswordGenerationPopupControllerImpl()

Powered by Google App Engine
This is Rietveld 408576698