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 // libgnome-keyring has been deprecated in favor of libsecret. | 8 // libgnome-keyring has been deprecated in favor of libsecret. |
9 // See: https://mail.gnome.org/archives/commits-list/2013-October/msg08876.html | 9 // See: https://mail.gnome.org/archives/commits-list/2013-October/msg08876.html |
10 // | 10 // |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // Declare the actual function pointers that we'll use in client code. | 64 // Declare the actual function pointers that we'll use in client code. |
65 #define GNOME_KEYRING_DECLARE_POINTER(name) \ | 65 #define GNOME_KEYRING_DECLARE_POINTER(name) \ |
66 static decltype(&::gnome_keyring_##name) gnome_keyring_##name; | 66 static decltype(&::gnome_keyring_##name) gnome_keyring_##name; |
67 GNOME_KEYRING_FOR_EACH_FUNC(GNOME_KEYRING_DECLARE_POINTER) | 67 GNOME_KEYRING_FOR_EACH_FUNC(GNOME_KEYRING_DECLARE_POINTER) |
68 #undef GNOME_KEYRING_DECLARE_POINTER | 68 #undef GNOME_KEYRING_DECLARE_POINTER |
69 | 69 |
70 // Set to true if LoadGnomeKeyring() has already succeeded. | 70 // Set to true if LoadGnomeKeyring() has already succeeded. |
71 static bool keyring_loaded; | 71 static bool keyring_loaded; |
72 | 72 |
73 private: | 73 private: |
74 #if defined(DLOPEN_GNOME_KEYRING) | |
75 struct FunctionInfo { | 74 struct FunctionInfo { |
76 const char* name; | 75 const char* name; |
77 void** pointer; | 76 void** pointer; |
78 }; | 77 }; |
79 | 78 |
80 // Make it easy to initialize the function pointers in LoadGnomeKeyring(). | 79 // Make it easy to initialize the function pointers in LoadGnomeKeyring(). |
81 static const FunctionInfo functions[]; | 80 static const FunctionInfo functions[]; |
82 #endif // defined(DLOPEN_GNOME_KEYRING) | |
83 }; | 81 }; |
84 | 82 |
85 // NativeBackend implementation using GNOME Keyring. | 83 // NativeBackend implementation using GNOME Keyring. |
86 class NativeBackendGnome : public PasswordStoreX::NativeBackend, | 84 class NativeBackendGnome : public PasswordStoreX::NativeBackend, |
87 public GnomeKeyringLoader { | 85 public GnomeKeyringLoader { |
88 public: | 86 public: |
89 explicit NativeBackendGnome(LocalProfileId id); | 87 explicit NativeBackendGnome(LocalProfileId id); |
90 | 88 |
91 ~NativeBackendGnome() override; | 89 ~NativeBackendGnome() override; |
92 | 90 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 TimestampToCompare date_to_compare, | 146 TimestampToCompare date_to_compare, |
149 password_manager::PasswordStoreChangeList* changes); | 147 password_manager::PasswordStoreChangeList* changes); |
150 | 148 |
151 // The app string, possibly based on the local profile id. | 149 // The app string, possibly based on the local profile id. |
152 std::string app_string_; | 150 std::string app_string_; |
153 | 151 |
154 DISALLOW_COPY_AND_ASSIGN(NativeBackendGnome); | 152 DISALLOW_COPY_AND_ASSIGN(NativeBackendGnome); |
155 }; | 153 }; |
156 | 154 |
157 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ | 155 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_ |
OLD | NEW |