Index: components/os_crypt/os_crypt.h |
diff --git a/components/os_crypt/os_crypt.h b/components/os_crypt/os_crypt.h |
index 287a28d7a733f54a522120ef97681c08340e8cbe..a9bbdb1a6a295260f5671039ed41af00e00f786c 100644 |
--- a/components/os_crypt/os_crypt.h |
+++ b/components/os_crypt/os_crypt.h |
@@ -11,9 +11,9 @@ |
#include "base/strings/string16.h" |
#include "build/build_config.h" |
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
+#if defined(USE_LIBSECRET) |
#include "components/os_crypt/key_storage_linux.h" |
-#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) |
+#endif |
// The OSCrypt class gives access to simple encryption and decryption of |
// strings. Note that on Mac, access to the system Keychain is required and |
@@ -21,13 +21,6 @@ |
// true for Linux, if a password management tool is available. |
class OSCrypt { |
public: |
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
- // If |store_type| is a known password store, we will attempt to use it. |
- // In any other case, we default to auto-detecting the store. |
- // This should not be changed after OSCrypt has been used. |
- static void SetStore(const std::string& store_type); |
-#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) |
- |
// Encrypt a string16. The output (second argument) is really an array of |
// bytes, but we're passing it back as a std::string. |
static bool EncryptString16(const base::string16& plaintext, |
@@ -59,7 +52,7 @@ |
DISALLOW_IMPLICIT_CONSTRUCTORS(OSCrypt); |
}; |
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST) |
+#if (defined(USE_LIBSECRET) || defined(USE_KWALLET)) && defined(UNIT_TEST) |
// For unit testing purposes, inject methods to be used. |
// |get_key_storage_mock| provides the desired |KeyStorage| implementation. |
// If the provider returns |nullptr|, a hardcoded password will be used. |
@@ -67,6 +60,7 @@ |
// If both parameters are |nullptr|, the real implementation is restored. |
void UseMockKeyStorageForTesting(KeyStorageLinux* (*get_key_storage_mock)(), |
std::string* (*get_password_v11_mock)()); |
-#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST) |
+#endif // (defined(USE_LIBSECRET) || defined(USE_KWALLET)) && |
+ // defined(UNIT_TEST) |
#endif // COMPONENTS_OS_CRYPT_OS_CRYPT_H_ |