OLD | NEW |
---|---|
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 for (size_t i = 0; i < password_list.size(); ++i) { | 194 for (size_t i = 0; i < password_list.size(); ++i) { |
195 base::ListValue* entry = new base::ListValue(); | 195 base::ListValue* entry = new base::ListValue(); |
196 entry->AppendString(GetHumanReadableOrigin(*password_list[i], languages_)); | 196 entry->AppendString(GetHumanReadableOrigin(*password_list[i], languages_)); |
197 entry->AppendString(password_list[i]->username_value); | 197 entry->AppendString(password_list[i]->username_value); |
198 if (show_passwords) { | 198 if (show_passwords) { |
199 entry->AppendString(password_list[i]->password_value); | 199 entry->AppendString(password_list[i]->password_value); |
200 } else { | 200 } else { |
201 // Use a placeholder value with the same length as the password. | 201 // Use a placeholder value with the same length as the password. |
202 entry->AppendString( | 202 entry->AppendString( |
203 base::string16(password_list[i]->password_value.length(), ' ')); | 203 base::string16(password_list[i]->password_value.length(), ' ')); |
204 } | 204 } |
Dan Beam
2015/03/03 22:49:54
nit:
const GURL& federation_url = password_list
| |
205 entry->AppendString( | |
206 password_list[i]->federation_url.is_empty() | |
207 ? base::string16() | |
208 : l10n_util::GetStringFUTF16( | |
209 IDS_PASSWORDS_VIA_FEDERATION, | |
210 base::UTF8ToUTF16(password_list[i]->federation_url.host()))); | |
205 entries.Append(entry); | 211 entries.Append(entry); |
206 } | 212 } |
207 | 213 |
208 web_ui()->CallJavascriptFunction("PasswordManager.setSavedPasswordsList", | 214 web_ui()->CallJavascriptFunction("PasswordManager.setSavedPasswordsList", |
209 entries); | 215 entries); |
210 } | 216 } |
211 | 217 |
212 void PasswordManagerHandler::SetPasswordExceptionList( | 218 void PasswordManagerHandler::SetPasswordExceptionList( |
213 const ScopedVector<autofill::PasswordForm>& password_exception_list) { | 219 const ScopedVector<autofill::PasswordForm>& password_exception_list) { |
214 base::ListValue entries; | 220 base::ListValue entries; |
215 for (size_t i = 0; i < password_exception_list.size(); ++i) { | 221 for (size_t i = 0; i < password_exception_list.size(); ++i) { |
216 entries.Append(new base::StringValue( | 222 entries.Append(new base::StringValue( |
217 net::FormatUrl(password_exception_list[i]->origin, languages_))); | 223 net::FormatUrl(password_exception_list[i]->origin, languages_))); |
218 } | 224 } |
219 | 225 |
220 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList", | 226 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList", |
221 entries); | 227 entries); |
222 } | 228 } |
223 | 229 |
224 } // namespace options | 230 } // namespace options |
OLD | NEW |