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/feature_list.h" | 9 #include "base/feature_list.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 scoped_refptr<password_manager::PasswordStore> store( | 368 scoped_refptr<password_manager::PasswordStore> store( |
369 PasswordStoreFactory::GetForProfile(profile_, | 369 PasswordStoreFactory::GetForProfile(profile_, |
370 ServiceAccessType::EXPLICIT_ACCESS)); | 370 ServiceAccessType::EXPLICIT_ACCESS)); |
371 if (store) { | 371 if (store) { |
372 for (const autofill::PasswordForm& form : forms) { | 372 for (const autofill::PasswordForm& form : forms) { |
373 store->AddLogin(form); | 373 store->AddLogin(form); |
374 } | 374 } |
375 } | 375 } |
376 UMA_HISTOGRAM_BOOLEAN("PasswordManager.StorePasswordImportedFromCSVResult", | 376 UMA_HISTOGRAM_BOOLEAN("PasswordManager.StorePasswordImportedFromCSVResult", |
377 store); | 377 static_cast<bool>(store)); |
378 } | 378 } |
379 | 379 |
380 void PasswordManagerHandler::HandlePasswordExport(const base::ListValue* args) { | 380 void PasswordManagerHandler::HandlePasswordExport(const base::ListValue* args) { |
381 #if !defined(OS_ANDROID) // This is never called on Android. | 381 #if !defined(OS_ANDROID) // This is never called on Android. |
382 if (!password_manager_presenter_->IsUserAuthenticated()) | 382 if (!password_manager_presenter_->IsUserAuthenticated()) |
383 return; | 383 return; |
384 | 384 |
385 ui::SelectFileDialog::FileTypeInfo file_type_info; | 385 ui::SelectFileDialog::FileTypeInfo file_type_info; |
386 file_type_info.extensions = | 386 file_type_info.extensions = |
387 password_manager::PasswordExporter::GetSupportedFileExtensions(); | 387 password_manager::PasswordExporter::GetSupportedFileExtensions(); |
(...skipping 16 matching lines...) Expand all Loading... |
404 password_manager_presenter_->GetAllPasswords(); | 404 password_manager_presenter_->GetAllPasswords(); |
405 UMA_HISTOGRAM_COUNTS("PasswordManager.ExportedPasswordsPerUserInCSV", | 405 UMA_HISTOGRAM_COUNTS("PasswordManager.ExportedPasswordsPerUserInCSV", |
406 password_list.size()); | 406 password_list.size()); |
407 password_manager::PasswordExporter::Export( | 407 password_manager::PasswordExporter::Export( |
408 path, password_list, content::BrowserThread::GetMessageLoopProxyForThread( | 408 path, password_list, content::BrowserThread::GetMessageLoopProxyForThread( |
409 content::BrowserThread::FILE) | 409 content::BrowserThread::FILE) |
410 .get()); | 410 .get()); |
411 } | 411 } |
412 | 412 |
413 } // namespace options | 413 } // namespace options |
OLD | NEW |