| # Copyright 2021 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| if (is_android) { |
| import("//build/config/android/rules.gni") |
| } |
| import("//components/optimization_guide/features.gni") |
| |
| static_library("browser") { |
| sources = [ |
| "optimization_guide_decider.h", |
| "page_content_annotations_service.cc", |
| "page_content_annotations_service.h", |
| "page_content_annotations_validator.cc", |
| "page_content_annotations_validator.h", |
| "page_content_annotations_web_contents_observer.cc", |
| "page_content_annotations_web_contents_observer.h", |
| "page_content_annotator.h", |
| "page_text_dump_result.cc", |
| "page_text_dump_result.h", |
| "page_text_observer.cc", |
| "page_text_observer.h", |
| "salient_image_retriever.cc", |
| "salient_image_retriever.h", |
| ] |
| if (build_with_tflite_lib) { |
| sources += [ |
| "page_content_annotations_model_manager.cc", |
| "page_content_annotations_model_manager.h", |
| ] |
| } |
| |
| public_deps = [ |
| "//base", |
| "//components/continuous_search/browser", |
| "//components/continuous_search/common/public/mojom", |
| "//components/google/core/common", |
| "//components/history/core/browser", |
| "//components/keyed_service/core", |
| "//components/no_state_prefetch/browser", |
| "//components/omnibox/browser", |
| "//components/optimization_guide:machine_learning_tflite_buildflags", |
| "//components/optimization_guide:optimization_guide_buildflags", |
| "//components/optimization_guide/content/mojom:mojo_interfaces", |
| "//components/optimization_guide/core", |
| "//components/optimization_guide/core:entities", |
| "//components/optimization_guide/proto:optimization_guide_proto", |
| "//components/search_engines", |
| "//content/public/browser", |
| "//services/metrics/public/cpp:metrics_cpp", |
| "//services/metrics/public/cpp:ukm_builders", |
| "//services/network/public/cpp", |
| "//third_party/omnibox_proto", |
| ] |
| if (build_with_tflite_lib) { |
| public_deps += [ |
| "//components/optimization_guide/core:machine_learning", |
| "//third_party/tflite", |
| "//third_party/tflite:tflite_public_headers", |
| "//third_party/tflite_support", |
| "//third_party/tflite_support:tflite_support_proto", |
| ] |
| } |
| } |
| |
| static_library("test_support") { |
| testonly = true |
| sources = [ |
| "test_optimization_guide_decider.cc", |
| "test_optimization_guide_decider.h", |
| "test_page_content_annotations_service.cc", |
| "test_page_content_annotations_service.h", |
| "test_page_content_annotator.cc", |
| "test_page_content_annotator.h", |
| ] |
| deps = [ |
| ":browser", |
| "//components/history/core/test", |
| "//components/optimization_guide/core:test_support", |
| "//content/public/browser", |
| "//testing/gtest", |
| ] |
| } |
| |
| source_set("unit_tests") { |
| testonly = true |
| sources = [ |
| "page_content_annotations_service_unittest.cc", |
| "page_content_annotations_validator_unittest.cc", |
| "page_content_annotations_web_contents_observer_unittest.cc", |
| "page_text_dump_result_unittest.cc", |
| "page_text_observer_unittest.cc", |
| ] |
| |
| # crbug.com/1279884 Flaky on CrOS |
| if (!is_chromeos && build_with_tflite_lib) { |
| sources += [ "page_content_annotations_model_manager_unittest.cc" ] |
| } |
| deps = [ |
| ":browser", |
| ":test_support", |
| "//components/history/core/test", |
| "//components/omnibox/browser:test_support", |
| "//components/optimization_guide/core:test_support", |
| "//components/prefs:test_support", |
| "//components/search_engines", |
| "//components/ukm:test_support", |
| "//content/test:test_support", |
| "//testing/gmock", |
| "//testing/gtest", |
| ] |
| if (build_with_tflite_lib) { |
| deps += [ |
| "//third_party/tflite", |
| "//third_party/tflite:tflite_public_headers", |
| "//third_party/tflite_support", |
| "//third_party/tflite_support:tflite_support_proto", |
| ] |
| } |
| } |