| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 base::string16 placeholder(base::ASCIIToUTF16(" ")); | 266 base::string16 placeholder(base::ASCIIToUTF16(" ")); |
| 267 for (const auto& saved_password : password_list) { | 267 for (const auto& saved_password : password_list) { |
| 268 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); | 268 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); |
| 269 CopyOriginInfoOfPasswordForm(*saved_password, entry.get()); | 269 CopyOriginInfoOfPasswordForm(*saved_password, entry.get()); |
| 270 | 270 |
| 271 entry->SetString(kUsernameField, saved_password->username_value); | 271 entry->SetString(kUsernameField, saved_password->username_value); |
| 272 // Use a placeholder value with the same length as the password. | 272 // Use a placeholder value with the same length as the password. |
| 273 entry->SetString( | 273 entry->SetString( |
| 274 kPasswordField, | 274 kPasswordField, |
| 275 base::string16(saved_password->password_value.length(), ' ')); | 275 base::string16(saved_password->password_value.length(), ' ')); |
| 276 if (!saved_password->federation_origin.unique()) { | 276 if (!saved_password->federation_origin.opaque()) { |
| 277 entry->SetString( | 277 entry->SetString( |
| 278 kFederationField, | 278 kFederationField, |
| 279 l10n_util::GetStringFUTF16( | 279 l10n_util::GetStringFUTF16( |
| 280 IDS_PASSWORDS_VIA_FEDERATION, | 280 IDS_PASSWORDS_VIA_FEDERATION, |
| 281 base::UTF8ToUTF16(saved_password->federation_origin.host()))); | 281 base::UTF8ToUTF16(saved_password->federation_origin.host()))); |
| 282 } | 282 } |
| 283 | 283 |
| 284 entries.Append(std::move(entry)); | 284 entries.Append(std::move(entry)); |
| 285 } | 285 } |
| 286 | 286 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 password_manager_presenter_->GetAllPasswords(); | 403 password_manager_presenter_->GetAllPasswords(); |
| 404 UMA_HISTOGRAM_COUNTS("PasswordManager.ExportedPasswordsPerUserInCSV", | 404 UMA_HISTOGRAM_COUNTS("PasswordManager.ExportedPasswordsPerUserInCSV", |
| 405 password_list.size()); | 405 password_list.size()); |
| 406 password_manager::PasswordExporter::Export( | 406 password_manager::PasswordExporter::Export( |
| 407 path, password_list, content::BrowserThread::GetTaskRunnerForThread( | 407 path, password_list, content::BrowserThread::GetTaskRunnerForThread( |
| 408 content::BrowserThread::FILE) | 408 content::BrowserThread::FILE) |
| 409 .get()); | 409 .get()); |
| 410 } | 410 } |
| 411 | 411 |
| 412 } // namespace options | 412 } // namespace options |
| OLD | NEW |