OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_PASSWORD_EXPORTER_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_PASSWORD_EXPORTER_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/callback_forward.h" |
| 12 #include "base/files/file_path.h" |
| 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_vector.h" |
| 16 |
| 17 namespace autofill { |
| 18 struct PasswordForm; |
| 19 } |
| 20 |
| 21 namespace base { |
| 22 class FilePath; |
| 23 class TaskRunner; |
| 24 } |
| 25 |
| 26 namespace password_manager { |
| 27 |
| 28 class PasswordExporter { |
| 29 public: |
| 30 // Exports |passwords| into a file at |path|, overwriting any existing file, |
| 31 // and fires |completion| on the calling thread when ready. Blocking IO tasks |
| 32 // will be posted to |blocking_task_runner|. The format of the export will be |
| 33 // selected based on the file extension in |path|. |
| 34 static void Export(const base::FilePath& path, |
| 35 ScopedVector<autofill::PasswordForm> passwords, |
| 36 scoped_refptr<base::TaskRunner> blocking_task_runner, |
| 37 const base::Closure& completion); |
| 38 |
| 39 // Returns the file extensions corresponding to supported formats. |
| 40 static std::vector<std::vector<base::FilePath::StringType>> |
| 41 GetSupportedFileExtensions(); |
| 42 |
| 43 private: |
| 44 DISALLOW_IMPLICIT_CONSTRUCTORS(PasswordExporter); |
| 45 }; |
| 46 |
| 47 } // namespace password_manager |
| 48 |
| 49 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_PASSWORD_EXPORTER_H_ |
OLD | NEW |