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

Unified Diff: blimp/client/core/BUILD.gn

Issue 2132163002: Add BlimpClientContext and factory with real and dummy implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-blimp-client-core-public-to-blimp-client
Patch Set: git merge origin/master before CQ for good measure Created 4 years, 5 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
Index: blimp/client/core/BUILD.gn
diff --git a/blimp/client/core/BUILD.gn b/blimp/client/core/BUILD.gn
index b98e4eb25feb0a456b6ed39da7bd5e76e5a25ba9..bd010128bf048e99ce02a080c1f154d59e365ad5 100644
--- a/blimp/client/core/BUILD.gn
+++ b/blimp/client/core/BUILD.gn
@@ -7,10 +7,35 @@ if (is_android) {
import("//build/config/android/rules.gni")
}
+declare_args() {
+ # Enables blimp. This is required to get the real implementation of blimp.
+ # By default, only a dummy-implementation is provided.
+ enable_blimp = false
+}
+
+# This target is here to let //chrome depend on //blimp/client/public
+# and automatically get the correct implementation of //blimp/client/core
+# depending on whether enable_blimp is set or not.
+group("core_shim") {
+ visibility = [ "//blimp/client/public" ]
+
+ if (enable_blimp) {
+ deps = [
+ ":core",
+ ]
+ } else {
+ deps = [
+ ":dummy_core",
+ ]
+ }
+}
+
source_set("core") {
- visibility = [ "//blimp/*" ]
+ visibility = [ "//blimp/client/*" ]
sources = [
+ "blimp_client_context_impl.cc",
+ "blimp_client_context_impl.h",
"blimp_contents_impl.cc",
"blimp_contents_impl.h",
"blimp_navigation_controller_delegate.h",
@@ -20,23 +45,51 @@ source_set("core") {
deps = [
"//base",
- "//blimp/client/public",
+ "//blimp/client/public:public_headers",
"//url",
]
if (is_android) {
sources += [
+ "android/blimp_client_context_impl_android.cc",
+ "android/blimp_client_context_impl_android.h",
"android/blimp_contents_factory.cc",
"android/blimp_contents_factory.h",
"android/blimp_contents_impl_android.cc",
"android/blimp_contents_impl_android.h",
"android/blimp_contents_observer_proxy.cc",
"android/blimp_contents_observer_proxy.h",
+ "android/blimp_jni_registrar.cc",
"android/blimp_navigation_controller_impl_android.cc",
"android/blimp_navigation_controller_impl_android.h",
]
- deps += [ "//blimp/client/core:core_jni_headers" ]
+ deps += [ ":core_jni_headers" ]
+ }
+}
+
+source_set("dummy_core") {
+ visibility = [ ":*" ]
+
+ sources = [
+ "dummy_blimp_client_context.cc",
+ "dummy_blimp_client_context.h",
+ ]
+
+ deps = [
+ "//base",
+ "//blimp/client/public:public_headers",
+ "//url",
+ ]
+
+ if (is_android) {
+ sources += [
+ "android/dummy_blimp_client_context_android.cc",
+ "android/dummy_blimp_client_context_android.h",
+ "android/dummy_blimp_jni_registrar.cc",
+ ]
+
+ deps += [ ":dummy_core_jni_headers" ]
}
}
@@ -44,24 +97,45 @@ source_set("unit_tests") {
testonly = true
sources = [
+ "blimp_client_context_impl_unittest.cc",
"blimp_contents_impl_unittest.cc",
"blimp_navigation_controller_impl_unittest.cc",
]
deps = [
+ ":core",
"//base",
- "//blimp/client/core",
- "//blimp/client/public",
+ "//blimp/client/public:public_headers",
+ "//blimp/client/test",
"//testing/gtest",
"//url",
]
}
if (is_android) {
+ # This target is here to let //chrome depend on
+ # //blimp/client/public:public_java and automatically get the correct
+ # implementation of //blimp/client/core depending on whether enable_blimp is
+ # set or not.
+ java_group("core_shim_java") {
+ visibility = [ "//blimp/client/public/*" ]
+
+ if (enable_blimp) {
+ deps = [
+ ":core_java",
+ ]
+ } else {
+ deps = [
+ ":dummy_core_java",
+ ]
+ }
+ }
+
android_library("core_java") {
- visibility = [ "//blimp/*" ]
+ visibility = [ "//blimp/client/*" ]
java_files = [
+ "android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java",
"android/java/src/org/chromium/blimp/core/BlimpContentsFactory.java",
"android/java/src/org/chromium/blimp/core/BlimpContentsImpl.java",
"android/java/src/org/chromium/blimp/core/BlimpContentsObserverProxy.java",
@@ -70,18 +144,42 @@ if (is_android) {
deps = [
"//base:base_java",
- "//blimp/client/public:public_java",
+ "//blimp/client/public:public_headers_java",
+ ]
+ }
+
+ android_library("dummy_core_java") {
+ visibility = [ ":*" ]
+
+ java_files = [ "android/java/src/org/chromium/blimp/core/DummyBlimpClientContext.java" ]
+
+ deps = [
+ "//base:base_java",
+ "//blimp/client/public:public_headers_java",
]
}
generate_jni("core_jni_headers") {
+ visibility = [ ":*" ]
+
sources = [
+ "android/java/src/org/chromium/blimp/core/BlimpClientContextImpl.java",
"android/java/src/org/chromium/blimp/core/BlimpContentsFactory.java",
"android/java/src/org/chromium/blimp/core/BlimpContentsImpl.java",
"android/java/src/org/chromium/blimp/core/BlimpContentsObserverProxy.java",
"android/java/src/org/chromium/blimp/core/BlimpNavigationControllerImpl.java",
]
- jni_package = "blimp"
+ jni_package = "blimp/client/core"
+ }
+
+ generate_jni("dummy_core_jni_headers") {
+ visibility = [ ":*" ]
+
+ sources = [
+ "android/java/src/org/chromium/blimp/core/DummyBlimpClientContext.java",
+ ]
+
+ jni_package = "blimp/client/core"
}
}
« no previous file with comments | « blimp/client/app/android/blimp_library_loader.cc ('k') | blimp/client/core/android/blimp_client_context_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698