Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: components/password_manager/core/browser/export/password_exporter.h

Issue 1193143003: Enable import/export of passwords into/from Password Manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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_ptr.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 std::vector<scoped_ptr<autofill::PasswordForm>> passwords,
36 scoped_refptr<base::TaskRunner> blocking_task_runner);
37
38 // Returns the file extensions corresponding to supported formats.
39 // Inner vector indicates equivalent extensions. For example:
40 // { { "html", "htm" }, { "csv" } }
41 static std::vector<std::vector<base::FilePath::StringType>>
42 GetSupportedFileExtensions();
43
44 private:
45 DISALLOW_IMPLICIT_CONSTRUCTORS(PasswordExporter);
46 };
47
48 } // namespace password_manager
49
50 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_EXPORT_PASSWORD_EXPORTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698