Chromium Code Reviews| Index: components/password_manager/core/browser/export/password_exporter.h |
| diff --git a/components/password_manager/core/browser/export/password_exporter.h b/components/password_manager/core/browser/export/password_exporter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f96a23c902d3cca737286ae594211af627217be3 |
| --- /dev/null |
| +++ b/components/password_manager/core/browser/export/password_exporter.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
|
vabr (Chromium)
2016/03/10 10:53:32
2016
xunlu
2016/03/16 07:23:59
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_PASSWORD_EXPORTER_H_ |
| +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_PASSWORD_EXPORTER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/callback_forward.h" |
| +#include "base/files/file_path.h" |
| +#include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| + |
| +namespace autofill { |
| +struct PasswordForm; |
| +} |
| + |
| +namespace base { |
| +class FilePath; |
| +class TaskRunner; |
| +} |
| + |
| +namespace password_manager { |
| + |
| +class PasswordExporter { |
| + public: |
| + // Exports |passwords| into a file at |path|, overwriting any existing file, |
| + // and fires |completion| on the calling thread when ready. Blocking IO tasks |
| + // will be posted to |blocking_task_runner|. The format of the export will be |
| + // selected based on the file extension in |path|. |
| + static void Export(const base::FilePath& path, |
| + std::vector<scoped_ptr<autofill::PasswordForm>> passwords, |
| + scoped_refptr<base::TaskRunner> blocking_task_runner, |
| + const base::Closure& completion); |
|
vabr (Chromium)
2016/03/10 10:53:32
Is |completion| used for anything right now? If no
xunlu
2016/03/16 07:23:59
I removed it
|
| + |
| + // Returns the file extensions corresponding to supported formats. |
| + static std::vector<std::vector<base::FilePath::StringType>> |
|
vabr (Chromium)
2016/03/10 10:53:32
Why is the type a vector of vectors? Could you eit
xunlu
2016/03/16 07:23:59
Comments updated.
|
| + GetSupportedFileExtensions(); |
| + |
| + private: |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(PasswordExporter); |
| +}; |
| + |
| +} // namespace password_manager |
| + |
| +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_PASSWORD_EXPORTER_H_ |