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_KWALLET_X_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_KWALLET_X_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_KWALLET_X_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_KWALLET_X_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "chrome/browser/password_manager/password_store_factory.h" | 13 #include "chrome/browser/password_manager/password_store_factory.h" |
14 #include "chrome/browser/password_manager/password_store_x.h" | 14 #include "chrome/browser/password_manager/password_store_x.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 | 16 |
17 class Pickle; | 17 class Pickle; |
18 class PickleIterator; | 18 class PickleIterator; |
19 class PrefService; | 19 class PrefService; |
20 | 20 |
21 namespace content { | 21 namespace autofill { |
22 struct PasswordForm; | 22 struct PasswordForm; |
23 } | 23 } |
24 | 24 |
25 namespace base { | 25 namespace base { |
26 class WaitableEvent; | 26 class WaitableEvent; |
27 } | 27 } |
28 | 28 |
29 namespace dbus { | 29 namespace dbus { |
30 class Bus; | 30 class Bus; |
31 class ObjectProxy; | 31 class ObjectProxy; |
32 } | 32 } |
33 | 33 |
34 // NativeBackend implementation using KWallet. | 34 // NativeBackend implementation using KWallet. |
35 class NativeBackendKWallet : public PasswordStoreX::NativeBackend { | 35 class NativeBackendKWallet : public PasswordStoreX::NativeBackend { |
36 public: | 36 public: |
37 NativeBackendKWallet(LocalProfileId id, PrefService* prefs); | 37 NativeBackendKWallet(LocalProfileId id, PrefService* prefs); |
38 | 38 |
39 virtual ~NativeBackendKWallet(); | 39 virtual ~NativeBackendKWallet(); |
40 | 40 |
41 virtual bool Init() OVERRIDE; | 41 virtual bool Init() OVERRIDE; |
42 | 42 |
43 // Implements NativeBackend interface. | 43 // Implements NativeBackend interface. |
44 virtual bool AddLogin(const content::PasswordForm& form) OVERRIDE; | 44 virtual bool AddLogin(const autofill::PasswordForm& form) OVERRIDE; |
45 virtual bool UpdateLogin(const content::PasswordForm& form) OVERRIDE; | 45 virtual bool UpdateLogin(const autofill::PasswordForm& form) OVERRIDE; |
46 virtual bool RemoveLogin(const content::PasswordForm& form) OVERRIDE; | 46 virtual bool RemoveLogin(const autofill::PasswordForm& form) OVERRIDE; |
47 virtual bool RemoveLoginsCreatedBetween( | 47 virtual bool RemoveLoginsCreatedBetween( |
48 const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; | 48 const base::Time& delete_begin, const base::Time& delete_end) OVERRIDE; |
49 virtual bool GetLogins(const content::PasswordForm& form, | 49 virtual bool GetLogins(const autofill::PasswordForm& form, |
50 PasswordFormList* forms) OVERRIDE; | 50 PasswordFormList* forms) OVERRIDE; |
51 virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, | 51 virtual bool GetLoginsCreatedBetween(const base::Time& get_begin, |
52 const base::Time& get_end, | 52 const base::Time& get_end, |
53 PasswordFormList* forms) OVERRIDE; | 53 PasswordFormList* forms) OVERRIDE; |
54 virtual bool GetAutofillableLogins(PasswordFormList* forms) OVERRIDE; | 54 virtual bool GetAutofillableLogins(PasswordFormList* forms) OVERRIDE; |
55 virtual bool GetBlacklistLogins(PasswordFormList* forms) OVERRIDE; | 55 virtual bool GetBlacklistLogins(PasswordFormList* forms) OVERRIDE; |
56 | 56 |
57 protected: | 57 protected: |
58 // Invalid handle returned by WalletHandle(). | 58 // Invalid handle returned by WalletHandle(). |
59 static const int kInvalidKWalletHandle = -1; | 59 static const int kInvalidKWalletHandle = -1; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 // The name of the wallet we've opened. Set during Init(). | 154 // The name of the wallet we've opened. Set during Init(). |
155 std::string wallet_name_; | 155 std::string wallet_name_; |
156 // The application name (e.g. "Chromium"), shown in KWallet auth dialogs. | 156 // The application name (e.g. "Chromium"), shown in KWallet auth dialogs. |
157 const std::string app_name_; | 157 const std::string app_name_; |
158 | 158 |
159 DISALLOW_COPY_AND_ASSIGN(NativeBackendKWallet); | 159 DISALLOW_COPY_AND_ASSIGN(NativeBackendKWallet); |
160 }; | 160 }; |
161 | 161 |
162 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_KWALLET_X_H_ | 162 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_KWALLET_X_H_ |
OLD | NEW |