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

Side by Side Diff: chrome/browser/password_manager/native_backend_libsecret.h

Issue 1929573002: Changed location of LibsecretLoader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODO and reference to bug Created 4 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_libsecret.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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_LIBSECRET_H_ 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_LIBSECRET_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_LIBSECRET_H_ 6 #define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_LIBSECRET_H_
7 7
8 #include <libsecret/secret.h>
9
10 #include <string> 8 #include <string>
11 9
12 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
13 #include "base/macros.h" 11 #include "base/macros.h"
14 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_vector.h"
15 #include "base/time/time.h" 13 #include "base/time/time.h"
16 #include "chrome/browser/password_manager/password_store_factory.h" 14 #include "chrome/browser/password_manager/password_store_factory.h"
17 #include "chrome/browser/password_manager/password_store_x.h" 15 #include "chrome/browser/password_manager/password_store_x.h"
18 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "components/os_crypt/libsecret_util_posix.h"
19 18
20 namespace autofill { 19 namespace autofill {
21 struct PasswordForm; 20 struct PasswordForm;
22 } 21 }
23 22
24 class LibsecretLoader { 23 class NativeBackendLibsecret : public PasswordStoreX::NativeBackend {
25 public:
26 static decltype(&::secret_password_store_sync) secret_password_store_sync;
27 static decltype(&::secret_service_search_sync) secret_service_search_sync;
28 static decltype(&::secret_password_clear_sync) secret_password_clear_sync;
29 static decltype(&::secret_item_get_secret) secret_item_get_secret;
30 static decltype(&::secret_value_get_text) secret_value_get_text;
31 static decltype(&::secret_item_get_attributes) secret_item_get_attributes;
32 static decltype(&::secret_item_load_secret_sync) secret_item_load_secret_sync;
33 static decltype(&::secret_value_unref) secret_value_unref;
34
35 protected:
36 static bool LoadLibsecret();
37 static bool LibsecretIsAvailable();
38
39 static bool libsecret_loaded;
40
41 private:
42 struct FunctionInfo {
43 const char* name;
44 void** pointer;
45 };
46
47 static const FunctionInfo functions[];
48 };
49
50 class NativeBackendLibsecret : public PasswordStoreX::NativeBackend,
51 public LibsecretLoader {
52 public: 24 public:
53 explicit NativeBackendLibsecret(LocalProfileId id); 25 explicit NativeBackendLibsecret(LocalProfileId id);
54 26
55 ~NativeBackendLibsecret() override; 27 ~NativeBackendLibsecret() override;
56 28
57 bool Init() override; 29 bool Init() override;
58 30
59 // Implements NativeBackend interface. 31 // Implements NativeBackend interface.
60 password_manager::PasswordStoreChangeList AddLogin( 32 password_manager::PasswordStoreChangeList AddLogin(
61 const autofill::PasswordForm& form) override; 33 const autofill::PasswordForm& form) override;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 GList* found, 100 GList* found,
129 const autofill::PasswordForm* lookup_form); 101 const autofill::PasswordForm* lookup_form);
130 102
131 // The app string, possibly based on the local profile id. 103 // The app string, possibly based on the local profile id.
132 std::string app_string_; 104 std::string app_string_;
133 105
134 DISALLOW_COPY_AND_ASSIGN(NativeBackendLibsecret); 106 DISALLOW_COPY_AND_ASSIGN(NativeBackendLibsecret);
135 }; 107 };
136 108
137 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_LIBSECRET_H_ 109 #endif // CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_LIBSECRET_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_libsecret.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698