| # Copyright 2023 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/features.gni") |
| |
| component("browser") { |
| sources = [ |
| "os_crypt_async.cc", |
| "os_crypt_async.h", |
| ] |
| |
| deps = [ ":key_provider_interface" ] |
| |
| public_deps = [ |
| "//base", |
| "//components/os_crypt/async/common", |
| ] |
| |
| defines = [ "IS_OS_CRYPT_ASYNC_IMPL" ] |
| } |
| |
| source_set("test_support") { |
| testonly = true |
| sources = [ |
| "test_utils.cc", |
| "test_utils.h", |
| ] |
| deps = [ "//crypto" ] |
| public_deps = [ |
| ":browser", |
| "//components/os_crypt/async/common:test_support", |
| ] |
| } |
| |
| source_set("key_provider_interface") { |
| sources = [ "key_provider.h" ] |
| |
| public_deps = [ |
| "//base", |
| "//components/os_crypt/async/common", |
| ] |
| } |
| |
| if (is_win) { |
| source_set("dpapi_key_provider") { |
| sources = [ |
| "dpapi_key_provider.cc", |
| "dpapi_key_provider.h", |
| ] |
| |
| deps = [ |
| ":key_provider_interface", |
| "//base", |
| "//components/os_crypt/async/common", |
| "//components/os_crypt/sync", |
| "//components/prefs", |
| ] |
| |
| libs = [ "crypt32.lib" ] |
| } |
| } |
| |
| if (is_linux && use_dbus) { |
| source_set("secret_portal_key_provider") { |
| sources = [ |
| "secret_portal_key_provider.cc", |
| "secret_portal_key_provider.h", |
| ] |
| |
| deps = [ |
| ":key_provider_interface", |
| "//base", |
| "//components/dbus", |
| "//components/os_crypt/async/common", |
| "//components/os_crypt/sync", |
| "//components/prefs", |
| "//crypto", |
| "//dbus", |
| ] |
| } |
| |
| source_set("freedesktop_secret_key_provider") { |
| sources = [ |
| "fallback_linux_key_provider.cc", |
| "fallback_linux_key_provider.h", |
| "freedesktop_secret_key_provider.cc", |
| "freedesktop_secret_key_provider.h", |
| ] |
| |
| deps = [ |
| ":key_provider_interface", |
| "//base", |
| "//components/dbus", |
| "//components/os_crypt/async/common", |
| "//components/os_crypt/sync", |
| "//crypto", |
| "//dbus", |
| ] |
| public_deps = [ "//build:branding_buildflags" ] |
| } |
| |
| source_set("test_secret_portal") { |
| testonly = true |
| |
| sources = [ |
| "test_secret_portal.cc", |
| "test_secret_portal.h", |
| ] |
| |
| deps = [ |
| ":key_provider_interface", |
| ":secret_portal_key_provider", |
| "//base", |
| "//components/dbus", |
| "//components/os_crypt/async/common", |
| "//dbus", |
| "//testing/gtest", |
| ] |
| } |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| sources = [ "os_crypt_async_unittest.cc" ] |
| deps = [ |
| ":browser", |
| ":key_provider_interface", |
| ":test_support", |
| "//base", |
| "//base/test:test_support", |
| "//components/os_crypt/async/common", |
| "//components/os_crypt/sync", |
| "//components/os_crypt/sync:test_support", |
| "//crypto", |
| "//testing/gtest", |
| ] |
| |
| if (is_win) { |
| sources += [ "dpapi_key_provider_unittest.cc" ] |
| deps += [ |
| ":dpapi_key_provider", |
| "//components/prefs:test_support", |
| ] |
| } |
| |
| if (is_linux && use_dbus) { |
| sources += [ |
| "freedesktop_secret_key_provider_compat_unittest.cc", |
| "freedesktop_secret_key_provider_unittest.cc", |
| "secret_portal_key_provider_unittest.cc", |
| ] |
| deps += [ |
| ":freedesktop_secret_key_provider", |
| ":secret_portal_key_provider", |
| "//components/dbus", |
| "//components/prefs:test_support", |
| "//dbus:test_support", |
| "//testing/gmock", |
| ] |
| } |
| } |