OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
| 10 #include <vector> |
9 | 11 |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/scoped_vector.h" | |
13 #include "base/time/time.h" | 14 #include "base/time/time.h" |
14 #include "chrome/browser/password_manager/password_store_factory.h" | 15 #include "chrome/browser/password_manager/password_store_factory.h" |
15 #include "chrome/browser/password_manager/password_store_x.h" | 16 #include "chrome/browser/password_manager/password_store_x.h" |
16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
17 #include "components/os_crypt/keyring_util_linux.h" | 18 #include "components/os_crypt/keyring_util_linux.h" |
18 | 19 |
19 namespace autofill { | 20 namespace autofill { |
20 struct PasswordForm; | 21 struct PasswordForm; |
21 } | 22 } |
22 | 23 |
(...skipping 18 matching lines...) Expand all Loading... |
41 base::Time delete_begin, | 42 base::Time delete_begin, |
42 base::Time delete_end, | 43 base::Time delete_end, |
43 password_manager::PasswordStoreChangeList* changes) override; | 44 password_manager::PasswordStoreChangeList* changes) override; |
44 bool RemoveLoginsSyncedBetween( | 45 bool RemoveLoginsSyncedBetween( |
45 base::Time delete_begin, | 46 base::Time delete_begin, |
46 base::Time delete_end, | 47 base::Time delete_end, |
47 password_manager::PasswordStoreChangeList* changes) override; | 48 password_manager::PasswordStoreChangeList* changes) override; |
48 bool DisableAutoSignInForOrigins( | 49 bool DisableAutoSignInForOrigins( |
49 const base::Callback<bool(const GURL&)>& origin_filter, | 50 const base::Callback<bool(const GURL&)>& origin_filter, |
50 password_manager::PasswordStoreChangeList* changes) override; | 51 password_manager::PasswordStoreChangeList* changes) override; |
51 bool GetLogins(const password_manager::PasswordStore::FormDigest& form, | 52 bool GetLogins( |
52 ScopedVector<autofill::PasswordForm>* forms) override; | 53 const password_manager::PasswordStore::FormDigest& form, |
| 54 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) override; |
53 bool GetAutofillableLogins( | 55 bool GetAutofillableLogins( |
54 ScopedVector<autofill::PasswordForm>* forms) override; | 56 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) override; |
55 bool GetBlacklistLogins(ScopedVector<autofill::PasswordForm>* forms) override; | 57 bool GetBlacklistLogins( |
56 bool GetAllLogins(ScopedVector<autofill::PasswordForm>* forms) override; | 58 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) override; |
| 59 bool GetAllLogins( |
| 60 std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) override; |
57 | 61 |
58 private: | 62 private: |
59 enum TimestampToCompare { | 63 enum TimestampToCompare { |
60 CREATION_TIMESTAMP, | 64 CREATION_TIMESTAMP, |
61 SYNC_TIMESTAMP, | 65 SYNC_TIMESTAMP, |
62 }; | 66 }; |
63 | 67 |
64 // Adds a login form without checking for one to replace first. | 68 // Adds a login form without checking for one to replace first. |
65 bool RawAddLogin(const autofill::PasswordForm& form); | 69 bool RawAddLogin(const autofill::PasswordForm& form); |
66 | 70 |
67 // Retrieves all autofillable or all blacklisted credentials (depending on | 71 // Retrieves all autofillable or all blacklisted credentials (depending on |
68 // |autofillable|) from the keyring into |forms|, overwriting the original | 72 // |autofillable|) from the keyring into |forms|, overwriting the original |
69 // contents of |forms|. Returns true on success. | 73 // contents of |forms|. Returns true on success. |
70 bool GetLoginsList(bool autofillable, | 74 bool GetLoginsList(bool autofillable, |
71 ScopedVector<autofill::PasswordForm>* forms) | 75 std::vector<std::unique_ptr<autofill::PasswordForm>>* |
72 WARN_UNUSED_RESULT; | 76 forms) WARN_UNUSED_RESULT; |
73 | 77 |
74 // Retrieves password created/synced in the time interval. Returns |true| if | 78 // Retrieves password created/synced in the time interval. Returns |true| if |
75 // the operation succeeded. | 79 // the operation succeeded. |
76 bool GetLoginsBetween(base::Time get_begin, | 80 bool GetLoginsBetween(base::Time get_begin, |
77 base::Time get_end, | 81 base::Time get_end, |
78 TimestampToCompare date_to_compare, | 82 TimestampToCompare date_to_compare, |
79 ScopedVector<autofill::PasswordForm>* forms) | 83 std::vector<std::unique_ptr<autofill::PasswordForm>>* |
80 WARN_UNUSED_RESULT; | 84 forms) WARN_UNUSED_RESULT; |
81 | 85 |
82 // Removes password created/synced in the time interval. Returns |true| if the | 86 // Removes password created/synced in the time interval. Returns |true| if the |
83 // operation succeeded. |changes| will contain the changes applied. | 87 // operation succeeded. |changes| will contain the changes applied. |
84 bool RemoveLoginsBetween(base::Time get_begin, | 88 bool RemoveLoginsBetween(base::Time get_begin, |
85 base::Time get_end, | 89 base::Time get_end, |
86 TimestampToCompare date_to_compare, | 90 TimestampToCompare date_to_compare, |
87 password_manager::PasswordStoreChangeList* changes); | 91 password_manager::PasswordStoreChangeList* changes); |
88 | 92 |
89 // The app string, possibly based on the local profile id. | 93 // The app string, possibly based on the local profile id. |
90 std::string app_string_; | 94 std::string app_string_; |
91 | 95 |
92 DISALLOW_COPY_AND_ASSIGN(NativeBackendGnome); | 96 DISALLOW_COPY_AND_ASSIGN(NativeBackendGnome); |
93 }; | 97 }; |
94 | 98 |
95 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ | 99 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ |
OLD | NEW |