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

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

Issue 1396403004: Remove dependency on Finch experiment PasswordLinkInSettings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Java comment addressed Created 5 years, 2 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
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"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 web_ui()->RegisterMessageCallback( 140 web_ui()->RegisterMessageCallback(
141 "requestShowPassword", 141 "requestShowPassword",
142 base::Bind(&PasswordManagerHandler::HandleRequestShowPassword, 142 base::Bind(&PasswordManagerHandler::HandleRequestShowPassword,
143 base::Unretained(this))); 143 base::Unretained(this)));
144 } 144 }
145 145
146 void PasswordManagerHandler::InitializeHandler() { 146 void PasswordManagerHandler::InitializeHandler() {
147 password_manager_presenter_.Initialize(); 147 password_manager_presenter_.Initialize();
148 } 148 }
149 149
150 void PasswordManagerHandler::InitializePage() {
151 base::FundamentalValue visible(
152 password_manager::ManageAccountLinkExperimentEnabled());
153 web_ui()->CallJavascriptFunction(
154 "PasswordManager.setManageAccountLinkVisibility", visible);
155 }
156
157 void PasswordManagerHandler::HandleRemoveSavedPassword( 150 void PasswordManagerHandler::HandleRemoveSavedPassword(
158 const base::ListValue* args) { 151 const base::ListValue* args) {
159 std::string string_value = base::UTF16ToUTF8(ExtractStringValue(args)); 152 std::string string_value = base::UTF16ToUTF8(ExtractStringValue(args));
160 int index; 153 int index;
161 if (base::StringToInt(string_value, &index) && index >= 0) { 154 if (base::StringToInt(string_value, &index) && index >= 0) {
162 password_manager_presenter_.RemoveSavedPassword(static_cast<size_t>(index)); 155 password_manager_presenter_.RemoveSavedPassword(static_cast<size_t>(index));
163 } 156 }
164 } 157 }
165 158
166 void PasswordManagerHandler::HandleRemovePasswordException( 159 void PasswordManagerHandler::HandleRemovePasswordException(
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 for (size_t i = 0; i < password_exception_list.size(); ++i) { 229 for (size_t i = 0; i < password_exception_list.size(); ++i) {
237 entries.AppendString(password_manager::GetHumanReadableOrigin( 230 entries.AppendString(password_manager::GetHumanReadableOrigin(
238 *password_exception_list[i], languages_)); 231 *password_exception_list[i], languages_));
239 } 232 }
240 233
241 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList", 234 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList",
242 entries); 235 entries);
243 } 236 }
244 237
245 } // namespace options 238 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698