# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//mojo/mojo_application_package.gni") import("//testing/test.gni") import("//third_party/mojo/src/mojo/public/mojo.gni") import("//third_party/mojo/src/mojo/public/mojo_application.gni") import("//tools/grit/repack.gni") # Repack this here. repack("unified_blink_resources") { sources = [ "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak", "$root_gen_dir/blink/public/resources/blink_resources.pak", ] output = "$target_gen_dir/unified_blink_resources.pak" deps = [ "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", ] } action("generate_blink_resource_map") { script = "//components/html_viewer/generate_blink_resource_map.py" args = [ "--pak-file", rebase_path("$target_gen_dir/unified_blink_resources.pak"), "--header", rebase_path("$target_gen_dir/blink_resource_map.h"), "--cpp", rebase_path("$target_gen_dir/blink_resource_map.cc"), ] outputs = [ "$target_gen_dir/blink_resource_map.cc", "$target_gen_dir/blink_resource_map.h", ] deps = [ ":unified_blink_resources", ] public_deps = [ "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", ] } source_set("lib") { sources = [ "$target_gen_dir/blink_resource_map.cc", "$target_gen_dir/blink_resource_map.h", "ax_provider_impl.cc", "ax_provider_impl.h", "blink_basic_type_converters.cc", "blink_basic_type_converters.h", "blink_input_events_type_converters.cc", "blink_input_events_type_converters.h", "blink_platform_impl.cc", "blink_platform_impl.h", "blink_resource_constants.h", "blink_url_request_type_converters.cc", "blink_url_request_type_converters.h", "discardable_memory_allocator.cc", "discardable_memory_allocator.h", "html_document.cc", "html_document.h", "mock_web_blob_registry_impl.cc", "mock_web_blob_registry_impl.h", "touch_handler.cc", "touch_handler.h", "web_clipboard_impl.cc", "web_clipboard_impl.h", "web_cookie_jar_impl.cc", "web_cookie_jar_impl.h", "web_layer_tree_view_impl.cc", "web_layer_tree_view_impl.h", "web_media_player_factory.cc", "web_media_player_factory.h", "web_media_player_factory.h", "web_message_port_channel_impl.cc", "web_message_port_channel_impl.h", "web_mime_registry_impl.cc", "web_mime_registry_impl.h", "web_notification_manager_impl.cc", "web_notification_manager_impl.h", "web_socket_handle_impl.cc", "web_socket_handle_impl.h", "web_storage_namespace_impl.cc", "web_storage_namespace_impl.h", "web_theme_engine_impl.cc", "web_theme_engine_impl.h", "web_url_loader_impl.cc", "web_url_loader_impl.h", ] include_dirs = [ "third_party/WebKit" ] deps = [ "//base", "//base/third_party/dynamic_annotations", "//cc", "//cc/blink", "//cc/surfaces", "//components/clipboard/public/interfaces", "//components/gpu/public/interfaces", "//components/mime_util", "//components/scheduler:scheduler", "//components/surfaces/public/interfaces", "//components/webcrypto", "//gin", "//mandoline/services/navigation/public/interfaces", "//media", "//media/blink", "//media/mojo", "//mojo/application", "//mojo/cc", "//mojo/common", "//mojo/converters/surfaces", "//mojo/services/network/public/cpp", "//mojo/services/network/public/interfaces", "//net", "//skia", "//third_party/mojo/src/mojo/public/c/system:for_shared_library", "//third_party/mojo/src/mojo/public/cpp/utility", "//third_party/mojo/src/mojo/public/interfaces/application", "//third_party/mojo_services/src/accessibility/public/interfaces", "//third_party/mojo_services/src/content_handler/public/interfaces", "//ui/mojo/events:interfaces", "//ui/events", "//ui/events:gesture_detection", "//ui/events/blink", "//ui/events/gestures/blink", "//ui/gfx/geometry", "//ui/native_theme", "//ui/resources:ui_test_pak", "//url", ] public_deps = [ "//components/view_manager/public/cpp", "//third_party/WebKit/public:blink", "//third_party/mojo/src/mojo/public/cpp/bindings", ":generate_blink_resource_map", ] if (is_win) { sources += [ "html_viewer_version.rc" ] } } if (is_android) { import("//build/config/android/rules.gni") java_library_path = "$target_out_dir/java_library.dex.jar" mojo_android_application("html_viewer") { input_so = "$root_out_dir/lib.stripped/libhtml_viewer_lib.so" input_dex_jar = java_library_path } shared_library("html_viewer_lib") { sources = [ "android/android_hooks.cc", "html_viewer.cc", ] deps = [ ":html_viewer_jni_headers", ":lib", "//base", "//ui/gfx:gfx_jni_headers", ] data_deps = [ "//mojo/services/network:network" ] } generate_jni("html_viewer_jni_headers") { sources = [ "android/java/org/chromium/html_viewer/Main.java", ] jni_package = "components/html_viewer" } android_library("html_viewer_java_classes") { java_files = [ "android/java/org/chromium/html_viewer/Main.java" ] deps = [ "//base:base_java", ] } android_standalone_library("java_library") { dex_path = java_library_path deps = [ ":html_viewer_java_classes", # TODO(sky): this is WAY more than we need. We really only need # DeviceDisplayInfo. Refactor to make this clearer. "//ui/android:ui_java", ] } } else { mojo_native_application("html_viewer") { sources = [ "html_viewer.cc", ] deps = [ ":lib", "//ui/resources:ui_test_pak", ] data_deps = [ "//mojo/services/network:network" ] } } test("html_viewer_unittests") { sources = [ "ax_provider_impl_unittest.cc", "discardable_memory_allocator_unittest.cc", ] deps = [ ":lib", "//base/test:run_all_unittests", ] } mojo_native_application("apptests") { output_name = "html_viewer_apptests" testonly = true sources = [ "ax_provider_apptest.cc", ] deps = [ ":lib", ":html_viewer", "//mojo/application:test_support", "//net:test_support", "//testing/gtest", ] }