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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 238 |
239 password_manager_presenter_->RequestShowPassword(static_cast<size_t>(index)); | 239 password_manager_presenter_->RequestShowPassword(static_cast<size_t>(index)); |
240 } | 240 } |
241 | 241 |
242 void PasswordManagerHandler::ShowPassword( | 242 void PasswordManagerHandler::ShowPassword( |
243 size_t index, | 243 size_t index, |
244 const std::string& origin_url, | 244 const std::string& origin_url, |
245 const std::string& username, | 245 const std::string& username, |
246 const base::string16& password_value) { | 246 const base::string16& password_value) { |
247 // Call back the front end to reveal the password. | 247 // Call back the front end to reveal the password. |
248 web_ui()->CallJavascriptFunctionUnsafe( | 248 web_ui()->CallJavascriptFunctionUnsafe("PasswordManager.showPassword", |
249 "PasswordManager.showPassword", | 249 base::Value(static_cast<int>(index)), |
250 base::FundamentalValue(static_cast<int>(index)), | 250 base::StringValue(password_value)); |
251 base::StringValue(password_value)); | |
252 } | 251 } |
253 | 252 |
254 void PasswordManagerHandler::HandleUpdatePasswordLists( | 253 void PasswordManagerHandler::HandleUpdatePasswordLists( |
255 const base::ListValue* args) { | 254 const base::ListValue* args) { |
256 password_manager_presenter_->UpdatePasswordLists(); | 255 password_manager_presenter_->UpdatePasswordLists(); |
257 } | 256 } |
258 | 257 |
259 void PasswordManagerHandler::SetPasswordList( | 258 void PasswordManagerHandler::SetPasswordList( |
260 const std::vector<std::unique_ptr<autofill::PasswordForm>>& password_list) { | 259 const std::vector<std::unique_ptr<autofill::PasswordForm>>& password_list) { |
261 base::ListValue entries; | 260 base::ListValue entries; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 password_manager_presenter_->GetAllPasswords(); | 398 password_manager_presenter_->GetAllPasswords(); |
400 UMA_HISTOGRAM_COUNTS("PasswordManager.ExportedPasswordsPerUserInCSV", | 399 UMA_HISTOGRAM_COUNTS("PasswordManager.ExportedPasswordsPerUserInCSV", |
401 password_list.size()); | 400 password_list.size()); |
402 password_manager::PasswordExporter::Export( | 401 password_manager::PasswordExporter::Export( |
403 path, password_list, content::BrowserThread::GetTaskRunnerForThread( | 402 path, password_list, content::BrowserThread::GetTaskRunnerForThread( |
404 content::BrowserThread::FILE) | 403 content::BrowserThread::FILE) |
405 .get()); | 404 .get()); |
406 } | 405 } |
407 | 406 |
408 } // namespace options | 407 } // namespace options |
OLD | NEW |