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

Unified Diff: chrome/browser/password_manager/native_backend_gnome_x.h

Issue 2216313002: Move GnomeKeyringLoader to components/os_crypt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed guard Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/password_manager/native_backend_gnome_x.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/native_backend_gnome_x.h
diff --git a/chrome/browser/password_manager/native_backend_gnome_x.h b/chrome/browser/password_manager/native_backend_gnome_x.h
index 5d28693229633a0d1df3579572c9dff00604b7d2..63edd8b27414af5fd31057936902dad1276e7e67 100644
--- a/chrome/browser/password_manager/native_backend_gnome_x.h
+++ b/chrome/browser/password_manager/native_backend_gnome_x.h
@@ -5,18 +5,6 @@
#ifndef CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_
#define CHROME_BROWSER_PASSWORD_MANAGER_NATIVE_BACKEND_GNOME_X_H_
-// libgnome-keyring has been deprecated in favor of libsecret.
-// See: https://mail.gnome.org/archives/commits-list/2013-October/msg08876.html
-//
-// The define below turns off the deprecations, in order to avoid build
-// failures with Gnome 3.12. When we move to libsecret, the define can be
-// removed, together with the include below it.
-//
-// The porting is tracked in http://crbug.com/355223
-#define GNOME_KEYRING_DEPRECATED
-#define GNOME_KEYRING_DEPRECATED_FOR(x)
-#include <gnome-keyring.h>
-
#include <string>
#include "base/compiler_specific.h"
@@ -26,55 +14,12 @@
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/password_manager/password_store_x.h"
#include "chrome/browser/profiles/profile.h"
+#include "components/os_crypt/keyring_util_linux.h"
namespace autofill {
struct PasswordForm;
}
-// Many of the gnome_keyring_* functions use variable arguments, which makes
-// them difficult if not impossible to truly wrap in C. Therefore, we use
-// appropriately-typed function pointers and scoping to make the fact that we
-// might be dynamically loading the library almost invisible. As a bonus, we
-// also get a simple way to mock the library for testing. Classes that inherit
-// from GnomeKeyringLoader will use its versions of the gnome_keyring_*
-// functions. Note that it has only static fields.
-class GnomeKeyringLoader {
- protected:
- static bool LoadGnomeKeyring();
-
- // Declare the actual function pointers that we'll use in client code.
- static decltype(&::gnome_keyring_is_available) gnome_keyring_is_available_ptr;
- static decltype(
- &::gnome_keyring_store_password) gnome_keyring_store_password_ptr;
- static decltype(
- &::gnome_keyring_delete_password) gnome_keyring_delete_password_ptr;
- static decltype(&::gnome_keyring_find_items) gnome_keyring_find_items_ptr;
- static decltype(
- &::gnome_keyring_result_to_message) gnome_keyring_result_to_message_ptr;
- static decltype(&::gnome_keyring_attribute_list_free)
- gnome_keyring_attribute_list_free_ptr;
- static decltype(
- &::gnome_keyring_attribute_list_new) gnome_keyring_attribute_list_new_ptr;
- static decltype(&::gnome_keyring_attribute_list_append_string)
- gnome_keyring_attribute_list_append_string_ptr;
- static decltype(&::gnome_keyring_attribute_list_append_uint32)
- gnome_keyring_attribute_list_append_uint32_ptr;
- // We also use gnome_keyring_attribute_list_index(), which is a macro and
- // can't be referenced.
-
- // Set to true if LoadGnomeKeyring() has already succeeded.
- static bool keyring_loaded;
-
- private:
- struct FunctionInfo {
- const char* name;
- void** pointer;
- };
-
- // Make it easy to initialize the function pointers in LoadGnomeKeyring().
- static const FunctionInfo functions[];
-};
-
// NativeBackend implementation using GNOME Keyring.
class NativeBackendGnome : public PasswordStoreX::NativeBackend,
public GnomeKeyringLoader {
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/password_manager/native_backend_gnome_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698