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/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "base/nix/xdg_util.h" |
14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
15 #include "chrome/browser/password_manager/password_store_factory.h" | 16 #include "chrome/browser/password_manager/password_store_factory.h" |
16 #include "chrome/browser/password_manager/password_store_x.h" | 17 #include "chrome/browser/password_manager/password_store_x.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 | 19 |
19 namespace autofill { | 20 namespace autofill { |
20 struct PasswordForm; | 21 struct PasswordForm; |
21 } | 22 } |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 class Pickle; | 25 class Pickle; |
25 class PickleIterator; | 26 class PickleIterator; |
26 class WaitableEvent; | 27 class WaitableEvent; |
27 } | 28 } |
28 | 29 |
29 namespace dbus { | 30 namespace dbus { |
30 class Bus; | 31 class Bus; |
31 class ObjectProxy; | 32 class ObjectProxy; |
32 } | 33 } |
33 | 34 |
34 // NativeBackend implementation using KWallet. | 35 // NativeBackend implementation using KWallet. |
35 class NativeBackendKWallet : public PasswordStoreX::NativeBackend { | 36 class NativeBackendKWallet : public PasswordStoreX::NativeBackend { |
36 public: | 37 public: |
37 explicit NativeBackendKWallet(LocalProfileId id); | 38 NativeBackendKWallet(LocalProfileId id, |
| 39 base::nix::DesktopEnvironment desktop_env); |
38 | 40 |
39 ~NativeBackendKWallet() override; | 41 ~NativeBackendKWallet() override; |
40 | 42 |
41 bool Init() override; | 43 bool Init() override; |
42 | 44 |
43 // Implements NativeBackend interface. | 45 // Implements NativeBackend interface. |
44 password_manager::PasswordStoreChangeList AddLogin( | 46 password_manager::PasswordStoreChangeList AddLogin( |
45 const autofill::PasswordForm& form) override; | 47 const autofill::PasswordForm& form) override; |
46 bool UpdateLogin(const autofill::PasswordForm& form, | 48 bool UpdateLogin(const autofill::PasswordForm& form, |
47 password_manager::PasswordStoreChangeList* changes) override; | 49 password_manager::PasswordStoreChangeList* changes) override; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // DBus handle for communication with klauncher and kwalletd. | 145 // DBus handle for communication with klauncher and kwalletd. |
144 scoped_refptr<dbus::Bus> session_bus_; | 146 scoped_refptr<dbus::Bus> session_bus_; |
145 // Object proxy for kwalletd. We do not own this. | 147 // Object proxy for kwalletd. We do not own this. |
146 dbus::ObjectProxy* kwallet_proxy_; | 148 dbus::ObjectProxy* kwallet_proxy_; |
147 | 149 |
148 // The name of the wallet we've opened. Set during Init(). | 150 // The name of the wallet we've opened. Set during Init(). |
149 std::string wallet_name_; | 151 std::string wallet_name_; |
150 // The application name (e.g. "Chromium"), shown in KWallet auth dialogs. | 152 // The application name (e.g. "Chromium"), shown in KWallet auth dialogs. |
151 const std::string app_name_; | 153 const std::string app_name_; |
152 | 154 |
| 155 // KWallet DBus name |
| 156 std::string dbus_service_name_; |
| 157 // DBus path to KWallet interfaces |
| 158 std::string dbus_path_; |
| 159 // The name used for logging and by klauncher when starting KWallet |
| 160 std::string kwalletd_name_; |
| 161 |
153 DISALLOW_COPY_AND_ASSIGN(NativeBackendKWallet); | 162 DISALLOW_COPY_AND_ASSIGN(NativeBackendKWallet); |
154 }; | 163 }; |
155 | 164 |
156 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_KWALLET_X_H_ | 165 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_KWALLET_X_H_ |
OLD | NEW |