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

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

Issue 1141413002: Prepare password_bubble_experiment and password_manager_util for componentisation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android 2 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/browser/ui/webui/options/browser_options_handler.cc ('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 #include "chrome/browser/sync/profile_sync_service.h"
17 #include "chrome/browser/sync/profile_sync_service_factory.h"
16 #if defined(OS_WIN) && defined(USE_ASH) 18 #if defined(OS_WIN) && defined(USE_ASH)
17 #include "chrome/browser/ui/ash/ash_util.h" 19 #include "chrome/browser/ui/ash/ash_util.h"
18 #endif 20 #endif
19 #include "chrome/browser/ui/passwords/password_bubble_experiment.h" 21 #include "chrome/browser/ui/passwords/password_bubble_experiment.h"
20 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
21 #include "chrome/common/url_constants.h" 23 #include "chrome/common/url_constants.h"
22 #include "chrome/grit/generated_resources.h" 24 #include "chrome/grit/generated_resources.h"
23 #include "components/autofill/core/common/password_form.h" 25 #include "components/autofill/core/common/password_form.h"
24 #include "components/password_manager/core/browser/affiliation_utils.h" 26 #include "components/password_manager/core/browser/affiliation_utils.h"
25 #include "components/password_manager/core/common/experiments.h" 27 #include "components/password_manager/core/common/experiments.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 { "passwordHideButton", 71 { "passwordHideButton",
70 IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON }, 72 IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON },
71 { "passwordsNoPasswordsDescription", 73 { "passwordsNoPasswordsDescription",
72 IDS_PASSWORDS_PAGE_VIEW_NO_PASSWORDS_DESCRIPTION }, 74 IDS_PASSWORDS_PAGE_VIEW_NO_PASSWORDS_DESCRIPTION },
73 { "passwordsNoExceptionsDescription", 75 { "passwordsNoExceptionsDescription",
74 IDS_PASSWORDS_PAGE_VIEW_NO_EXCEPTIONS_DESCRIPTION }, 76 IDS_PASSWORDS_PAGE_VIEW_NO_EXCEPTIONS_DESCRIPTION },
75 }; 77 };
76 78
77 RegisterStrings(localized_strings, resources, arraysize(resources)); 79 RegisterStrings(localized_strings, resources, arraysize(resources));
78 80
81 const ProfileSyncService* sync_service =
82 ProfileSyncServiceFactory::GetForProfile(GetProfile());
79 int title_id = 83 int title_id =
80 password_bubble_experiment::IsSmartLockBrandingEnabled(GetProfile()) ? 84 password_bubble_experiment::IsSmartLockBrandingEnabled(sync_service) ?
81 IDS_PASSWORDS_EXCEPTIONS_SMART_LOCK_WINDOW_TITLE : 85 IDS_PASSWORDS_EXCEPTIONS_SMART_LOCK_WINDOW_TITLE :
82 IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE; 86 IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE;
83 RegisterTitle(localized_strings, "passwordsPage", title_id); 87 RegisterTitle(localized_strings, "passwordsPage", title_id);
84 88
85 localized_strings->SetString("passwordManagerLearnMoreURL", 89 localized_strings->SetString("passwordManagerLearnMoreURL",
86 chrome::kPasswordManagerLearnMoreURL); 90 chrome::kPasswordManagerLearnMoreURL);
87 localized_strings->SetString("passwordsManagePasswordsLink", 91 localized_strings->SetString("passwordsManagePasswordsLink",
88 chrome::kPasswordManagerAccountDashboardURL); 92 chrome::kPasswordManagerAccountDashboardURL);
89 93
90 std::string management_hostname = 94 std::string management_hostname =
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 for (size_t i = 0; i < password_exception_list.size(); ++i) { 234 for (size_t i = 0; i < password_exception_list.size(); ++i) {
231 entries.AppendString(password_manager::GetHumanReadableOrigin( 235 entries.AppendString(password_manager::GetHumanReadableOrigin(
232 *password_exception_list[i], languages_)); 236 *password_exception_list[i], languages_));
233 } 237 }
234 238
235 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList", 239 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList",
236 entries); 240 entries);
237 } 241 }
238 242
239 } // namespace options 243 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698