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

Side by Side Diff: chrome/browser/ui/webui/options/password_manager_handler.cc

Issue 1137183004: [Smart Lock] Update strings in chrome://settings/passwords (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments 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 unified diff | Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/password_manager_handler.h" 5 #include "chrome/browser/ui/webui/options/password_manager_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #if defined(OS_WIN) && defined(USE_ASH) 16 #if defined(OS_WIN) && defined(USE_ASH)
17 #include "chrome/browser/ui/ash/ash_util.h" 17 #include "chrome/browser/ui/ash/ash_util.h"
18 #endif 18 #endif
19 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" 19 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h"
20 #include "chrome/browser/ui/passwords/password_bubble_experiment.h"
20 #include "chrome/common/pref_names.h" 21 #include "chrome/common/pref_names.h"
21 #include "chrome/common/url_constants.h" 22 #include "chrome/common/url_constants.h"
22 #include "chrome/grit/generated_resources.h" 23 #include "chrome/grit/generated_resources.h"
23 #include "components/autofill/core/common/password_form.h" 24 #include "components/autofill/core/common/password_form.h"
24 #include "components/password_manager/core/common/experiments.h" 25 #include "components/password_manager/core/common/experiments.h"
25 #include "content/public/browser/notification_details.h" 26 #include "content/public/browser/notification_details.h"
26 #include "content/public/browser/notification_source.h" 27 #include "content/public/browser/notification_source.h"
27 #include "content/public/browser/user_metrics.h" 28 #include "content/public/browser/user_metrics.h"
28 #include "content/public/browser/web_contents.h" 29 #include "content/public/browser/web_contents.h"
29 #include "content/public/browser/web_ui.h" 30 #include "content/public/browser/web_ui.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 IDS_PASSWORDS_PAGE_VIEW_SHOW_BUTTON }, 68 IDS_PASSWORDS_PAGE_VIEW_SHOW_BUTTON },
68 { "passwordHideButton", 69 { "passwordHideButton",
69 IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON }, 70 IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON },
70 { "passwordsNoPasswordsDescription", 71 { "passwordsNoPasswordsDescription",
71 IDS_PASSWORDS_PAGE_VIEW_NO_PASSWORDS_DESCRIPTION }, 72 IDS_PASSWORDS_PAGE_VIEW_NO_PASSWORDS_DESCRIPTION },
72 { "passwordsNoExceptionsDescription", 73 { "passwordsNoExceptionsDescription",
73 IDS_PASSWORDS_PAGE_VIEW_NO_EXCEPTIONS_DESCRIPTION }, 74 IDS_PASSWORDS_PAGE_VIEW_NO_EXCEPTIONS_DESCRIPTION },
74 }; 75 };
75 76
76 RegisterStrings(localized_strings, resources, arraysize(resources)); 77 RegisterStrings(localized_strings, resources, arraysize(resources));
77 RegisterTitle(localized_strings, "passwordsPage", 78
78 IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE); 79 int title_id =
80 password_bubble_experiment::IsSmartLockBrandingEnabled(GetProfile()) ?
81 IDS_PASSWORDS_EXCEPTIONS_SMART_LOCK_WINDOW_TITLE :
82 IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE;
83 RegisterTitle(localized_strings, "passwordsPage", title_id);
79 84
80 localized_strings->SetString("passwordManagerLearnMoreURL", 85 localized_strings->SetString("passwordManagerLearnMoreURL",
81 chrome::kPasswordManagerLearnMoreURL); 86 chrome::kPasswordManagerLearnMoreURL);
82 localized_strings->SetString("passwordsManagePasswordsLink", 87 localized_strings->SetString("passwordsManagePasswordsLink",
83 chrome::kPasswordManagerAccountDashboardURL); 88 chrome::kPasswordManagerAccountDashboardURL);
84 89
85 std::vector<base::string16> pieces; 90 std::string management_hostname =
86 base::SplitStringDontTrim( 91 GURL(chrome::kPasswordManagerAccountDashboardURL).host();
87 l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_REMOTE_TEXT), 92 base::string16 link_text = base::UTF8ToUTF16(management_hostname);
88 '|', // separator 93 size_t offset;
89 &pieces); 94 base::string16 full_text = l10n_util::GetStringFUTF16(
90 DCHECK_EQ(3U, pieces.size()); 95 IDS_MANAGE_PASSWORDS_REMOTE_TEXT, link_text, &offset);
96
91 localized_strings->SetString("passwordsManagePasswordsBeforeLinkText", 97 localized_strings->SetString("passwordsManagePasswordsBeforeLinkText",
92 pieces[0]); 98 full_text.substr(0, offset));
93 localized_strings->SetString("passwordsManagePasswordsLinkText", pieces[1]); 99 localized_strings->SetString("passwordsManagePasswordsLinkText",
100 full_text.substr(offset,
101 offset + link_text.size()));
94 localized_strings->SetString("passwordsManagePasswordsAfterLinkText", 102 localized_strings->SetString("passwordsManagePasswordsAfterLinkText",
95 pieces[2]); 103 full_text.substr(offset + link_text.size()));
96 104
97 bool disable_show_passwords = false; 105 bool disable_show_passwords = false;
98 106
99 #if defined(OS_WIN) && defined(USE_ASH) 107 #if defined(OS_WIN) && defined(USE_ASH)
100 // We disable the ability to show passwords when running in Windows Metro 108 // We disable the ability to show passwords when running in Windows Metro
101 // interface. This is because we cannot pop native Win32 dialogs from the 109 // interface. This is because we cannot pop native Win32 dialogs from the
102 // Metro process. 110 // Metro process.
103 // TODO(wfh): Revisit this if Metro usage grows. 111 // TODO(wfh): Revisit this if Metro usage grows.
104 if (chrome::IsNativeWindowInAsh(GetNativeWindow())) 112 if (chrome::IsNativeWindowInAsh(GetNativeWindow()))
105 disable_show_passwords = true; 113 disable_show_passwords = true;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 for (size_t i = 0; i < password_exception_list.size(); ++i) { 229 for (size_t i = 0; i < password_exception_list.size(); ++i) {
222 entries.AppendString( 230 entries.AppendString(
223 GetHumanReadableOrigin(*password_exception_list[i], languages_)); 231 GetHumanReadableOrigin(*password_exception_list[i], languages_));
224 } 232 }
225 233
226 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList", 234 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList",
227 entries); 235 entries);
228 } 236 }
229 237
230 } // namespace options 238 } // namespace options
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698