Commit 9bef2ebf authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

Create target in //components/signin for shared code

//components/signin/core/browser contains three different types of code:

1. Code that forms the guts of IdentityManager and will form the guts of
the Identity Service implementation (e.g., SigninManager).

2. Code that will be clients of IdentityManager (e.g., SigninTracker).

3. Code that will be used on both sides (e.g., AccountInfo).

1 and 2 have already been split via a preceding CL. This CL creates 3.
To start off with, 3 contains two pieces of code that were already in
their own standalone targets for similar motivations as the above:
account_info.* and signin_metrics.*. In the future more code will
likely move in.

Bug: 901859
Change-Id: Ibcae3c9f1ecff2dc7ccd013046b74c97b3dd2b7a
Reviewed-on: https://chromium-review.googlesource.com/c/1323114Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606783}
parent 8c814268
...@@ -278,7 +278,7 @@ jumbo_static_library("browser") { ...@@ -278,7 +278,7 @@ jumbo_static_library("browser") {
"//components/os_crypt", "//components/os_crypt",
"//components/pref_registry", "//components/pref_registry",
"//components/prefs", "//components/prefs",
"//components/signin/core/browser:signin_metrics", "//components/signin/core/browser:shared",
"//components/strings", "//components/strings",
"//components/sync", "//components/sync",
"//components/variations/net", "//components/variations/net",
......
...@@ -17,30 +17,23 @@ buildflag_header("signin_buildflags") { ...@@ -17,30 +17,23 @@ buildflag_header("signin_buildflags") {
] ]
} }
# Split into its own target to allow the Identity Service to depend on it in # This target contains code that will be shared between the Identity Service
# typemaps without introducing a dependency on all of # implementation and its client library/clients. Currently, this code is used
# //components/signin/core/browser, which is undesirable. In the long term # both by IdentityManager and by its clients.
# this file will move to be part of the Identity Service client library. static_library("shared") {
static_library("account_info") {
sources = [ sources = [
"account_info.cc", "account_info.cc",
"account_info.h", "account_info.h",
"signin_metrics.cc",
"signin_metrics.h",
] ]
deps = [ deps = [
"//components/account_id", "//components/account_id",
] ]
}
# Split into its own target to allow browser clients of the Identity Service to
# record browser-specific signin metrics without having to depend on all of
# //components/signin/core/browser.
static_library("signin_metrics") {
sources = [
"signin_metrics.cc",
"signin_metrics.h",
]
public_deps = [ public_deps = [
"//base", "//base",
# TODO(blundell): Analyze this dependency.
"//google_apis", "//google_apis",
] ]
} }
...@@ -84,9 +77,8 @@ static_library("internals") { ...@@ -84,9 +77,8 @@ static_library("internals") {
} }
deps = [ deps = [
":account_info", ":shared",
":signin_buildflags", ":signin_buildflags",
":signin_metrics",
"//base", "//base",
"//components/data_use_measurement/core", "//components/data_use_measurement/core",
"//components/keyed_service/core", "//components/keyed_service/core",
...@@ -152,10 +144,9 @@ static_library("browser") { ...@@ -152,10 +144,9 @@ static_library("browser") {
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
public_deps = [ public_deps = [
":account_info",
":internals", ":internals",
":shared",
":signin_buildflags", ":signin_buildflags",
":signin_metrics",
"//base", "//base",
"//components/account_id", "//components/account_id",
"//components/content_settings/core/browser", "//components/content_settings/core/browser",
...@@ -236,7 +227,7 @@ static_library("internals_test_support") { ...@@ -236,7 +227,7 @@ static_library("internals_test_support") {
public_deps = [ public_deps = [
":internals", ":internals",
":signin_metrics", ":shared",
"//base", "//base",
"//services/network:test_support", "//services/network:test_support",
] ]
......
...@@ -814,7 +814,7 @@ static_library("test_support_driver") { ...@@ -814,7 +814,7 @@ static_library("test_support_driver") {
deps = [ deps = [
":sync", ":sync",
":test_support_engine", ":test_support_engine",
"//components/signin/core/browser:account_info", "//components/signin/core/browser:shared",
"//components/sync_preferences:test_support", "//components/sync_preferences:test_support",
"//components/version_info", "//components/version_info",
"//google_apis", "//google_apis",
......
...@@ -189,7 +189,7 @@ source_set("eg_test_support") { ...@@ -189,7 +189,7 @@ source_set("eg_test_support") {
":authentication_ui", ":authentication_ui",
"unified_consent", "unified_consent",
"//components/signin/core/browser", "//components/signin/core/browser",
"//components/signin/core/browser:account_info", "//components/signin/core/browser:shared",
"//components/unified_consent", "//components/unified_consent",
"//ios/chrome/app/strings:ios_strings_grit", "//ios/chrome/app/strings:ios_strings_grit",
"//ios/chrome/browser/browser_state", "//ios/chrome/browser/browser_state",
......
...@@ -19,7 +19,7 @@ source_set("lib") { ...@@ -19,7 +19,7 @@ source_set("lib") {
deps = [ deps = [
"//base", "//base",
"//components/signin/core/browser", "//components/signin/core/browser",
"//components/signin/core/browser:account_info", "//components/signin/core/browser:shared",
"//services/identity/public/cpp:cpp_types", "//services/identity/public/cpp:cpp_types",
"//services/identity/public/mojom", "//services/identity/public/mojom",
"//services/service_manager/public/cpp", "//services/service_manager/public/cpp",
...@@ -40,7 +40,7 @@ source_set("tests") { ...@@ -40,7 +40,7 @@ source_set("tests") {
"//base/test:test_support", "//base/test:test_support",
"//components/prefs:test_support", "//components/prefs:test_support",
"//components/signin/core/browser", "//components/signin/core/browser",
"//components/signin/core/browser:account_info", "//components/signin/core/browser:shared",
"//components/signin/core/browser:test_support", "//components/signin/core/browser:test_support",
"//components/sync_preferences:test_support", "//components/sync_preferences:test_support",
"//mojo/public/cpp/bindings:bindings", "//mojo/public/cpp/bindings:bindings",
......
...@@ -25,9 +25,8 @@ source_set("cpp") { ...@@ -25,9 +25,8 @@ source_set("cpp") {
configs += [ "//build/config/compiler:wexit_time_destructors" ] configs += [ "//build/config/compiler:wexit_time_destructors" ]
public_deps = [ public_deps = [
"//components/signin/core/browser:account_info",
"//components/signin/core/browser:internals", "//components/signin/core/browser:internals",
"//components/signin/core/browser:signin_metrics", "//components/signin/core/browser:shared",
"//services/identity/public/cpp:cpp_types", "//services/identity/public/cpp:cpp_types",
"//services/network/public/cpp", "//services/network/public/cpp",
] ]
......
...@@ -13,7 +13,7 @@ public_deps = [ ...@@ -13,7 +13,7 @@ public_deps = [
# TODO(blundell): In the long term, any files from //components/signin that # TODO(blundell): In the long term, any files from //components/signin that
# are exposed to consumers of the Identity Service should move to be part of # are exposed to consumers of the Identity Service should move to be part of
# the client library of the Identity Service. # the client library of the Identity Service.
"//components/signin/core/browser:account_info", "//components/signin/core/browser:shared",
] ]
type_mappings = [ "identity.mojom.AccountInfo=::AccountInfo" ] type_mappings = [ "identity.mojom.AccountInfo=::AccountInfo" ]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment