# 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("//build/buildflag_header.gni") import("//device/vr/features/features.gni") import("//third_party/protobuf/proto_library.gni") import("//components/vector_icons/vector_icons.gni") if (is_android) { import("//build/config/android/rules.gni") } buildflag_header("build_features") { header = "features.h" flags = [ "ENABLE_VR=$enable_vr" ] } aggregate_vector_icons("omnibox_vector_icons") { icon_directory = "vector_icons" icons = [ "blank.1x.icon", "blank.icon", "calculator.1x.icon", "calculator.icon", "extension_app.1x.icon", "extension_app.icon", "http.icon", "keyword_search.icon", "star.1x.icon", "star.icon", "tab.icon", ] } static_library("browser") { sources = [ "answers_cache.cc", "answers_cache.h", "autocomplete_classifier.cc", "autocomplete_classifier.h", "autocomplete_controller.cc", "autocomplete_controller.h", "autocomplete_controller_delegate.h", "autocomplete_input.cc", "autocomplete_input.h", "autocomplete_match.cc", "autocomplete_match.h", "autocomplete_match_type.cc", "autocomplete_match_type.h", "autocomplete_provider.cc", "autocomplete_provider.h", "autocomplete_result.cc", "autocomplete_result.h", "autocomplete_scheme_classifier.h", "base_search_provider.cc", "base_search_provider.h", "bookmark_provider.cc", "bookmark_provider.h", "tailored_word_break_iterator.cc", "tailored_word_break_iterator.h", "builtin_provider.cc", "builtin_provider.h", "clipboard_url_provider.cc", "clipboard_url_provider.h", "contextual_suggestions_service.cc", "contextual_suggestions_service.h", "features.h", "history_match.cc", "history_match.h", "history_provider.cc", "history_provider.h", "history_quick_provider.cc", "history_quick_provider.h", "history_url_provider.cc", "history_url_provider.h", "in_memory_url_index.cc", "in_memory_url_index.h", "in_memory_url_index_types.cc", "in_memory_url_index_types.h", "keyword_extensions_delegate.cc", "keyword_extensions_delegate.h", "keyword_provider.cc", "keyword_provider.h", "match_compare.h", "omnibox_client.cc", "omnibox_client.h", "omnibox_controller.cc", "omnibox_controller.h", "omnibox_edit_controller.cc", "omnibox_edit_controller.h", "omnibox_edit_model.cc", "omnibox_edit_model.h", "omnibox_event_global_tracker.cc", "omnibox_event_global_tracker.h", "omnibox_field_trial.cc", "omnibox_field_trial.h", "omnibox_log.cc", "omnibox_log.h", "omnibox_metrics_provider.cc", "omnibox_metrics_provider.h", "omnibox_navigation_observer.h", "omnibox_popup_model.cc", "omnibox_popup_model.h", "omnibox_popup_model_observer.h", "omnibox_popup_view.h", "omnibox_pref_names.cc", "omnibox_pref_names.h", "omnibox_switches.cc", "omnibox_switches.h", "omnibox_view.cc", "omnibox_view.h", "physical_web_node.cc", "physical_web_node.h", "physical_web_provider.cc", "physical_web_provider.h", "scored_history_match.cc", "scored_history_match.h", "search_provider.cc", "search_provider.h", "search_suggestion_parser.cc", "search_suggestion_parser.h", "shortcuts_backend.cc", "shortcuts_backend.h", "shortcuts_constants.cc", "shortcuts_constants.h", "shortcuts_database.cc", "shortcuts_database.h", "shortcuts_provider.cc", "shortcuts_provider.h", "suggestion_answer.cc", "suggestion_answer.h", "titled_url_match_utils.cc", "titled_url_match_utils.h", "url_index_private_data.cc", "url_index_private_data.h", "url_prefix.cc", "url_prefix.h", "verbatim_match.cc", "verbatim_match.h", "zero_suggest_provider.cc", "zero_suggest_provider.h", ] defines = [ "OMNIBOX_BROWSER_IMPLEMENTATION" ] public_deps = [ "//components/history/core/browser", "//components/omnibox/common", "//third_party/metrics_proto", ] deps = [ ":build_features", ":in_memory_url_index_cache_proto", "//base", "//base:i18n", "//components/bookmarks/browser", "//components/data_use_measurement/core", "//components/keyed_service/core", "//components/metrics", "//components/navigation_metrics", "//components/open_from_clipboard", "//components/physical_web/data_source", "//components/pref_registry", "//components/prefs", "//components/query_parser", "//components/resources", "//components/search", "//components/search_engines", "//components/sessions", "//components/signin/core/browser", "//components/strings", "//components/toolbar", "//components/url_formatter", "//components/variations", "//components/variations/net", "//extensions/common:common_constants", "//net", "//skia", "//sql", "//third_party/protobuf:protobuf_lite", "//ui/base", "//ui/gfx", "//url", ] if ((!is_android || enable_vr) && !is_ios) { sources += get_target_outputs(":omnibox_vector_icons") deps += [ ":omnibox_vector_icons", "//components/vector_icons", ] } # TODO(brettw) Fix the include cycle and remove this line. allow_circular_includes_from = [ "//components/search_engines" ] } if (is_android) { java_cpp_enum("autocomplete_match_javagen") { sources = [ "autocomplete_match.h", ] } java_cpp_enum("autocomplete_match_type_javagen") { sources = [ "autocomplete_match_type.h", ] } } proto_library("in_memory_url_index_cache_proto") { sources = [ "in_memory_url_index_cache.proto", ] } static_library("test_support") { testonly = true sources = [ "fake_autocomplete_provider_client.cc", "fake_autocomplete_provider_client.h", "history_index_restore_observer.cc", "history_index_restore_observer.h", "history_test_util.cc", "history_test_util.h", "in_memory_url_index_test_util.cc", "in_memory_url_index_test_util.h", "mock_autocomplete_provider_client.cc", "mock_autocomplete_provider_client.h", "shortcuts_provider_test_util.cc", "shortcuts_provider_test_util.h", "test_omnibox_client.cc", "test_omnibox_client.h", "test_omnibox_edit_controller.cc", "test_omnibox_edit_controller.h", "test_omnibox_view.cc", "test_omnibox_view.h", "test_scheme_classifier.cc", "test_scheme_classifier.h", ] deps = [ ":browser", "//base", "//base/test:test_support", "//components/bookmarks/browser", "//components/bookmarks/test", "//components/history/core/browser", "//components/history/core/test", "//components/search_engines", "//components/sessions", "//components/toolbar:test_support", "//net", "//testing/gmock", "//testing/gtest", "//third_party/metrics_proto", "//ui/base", ] } bundle_data("unit_tests_bundle_data") { visibility = [ ":unit_tests" ] testonly = true sources = [ "//components/test/data/omnibox/Shortcuts.no_fill_into_edit.sql", "//components/test/data/omnibox/Shortcuts.v0.sql", "//components/test/data/omnibox/in_memory_url_index_test.sql", "//components/test/data/omnibox/in_memory_url_index_test_limited.sql", ] outputs = [ "{{bundle_resources_dir}}/" + "{{source_root_relative_dir}}/{{source_file_part}}", ] } source_set("unit_tests") { testonly = true sources = [ "answers_cache_unittest.cc", "autocomplete_input_unittest.cc", "autocomplete_match_type_unittest.cc", "autocomplete_match_unittest.cc", "autocomplete_provider_unittest.cc", "autocomplete_result_unittest.cc", "base_search_provider_unittest.cc", "bookmark_provider_unittest.cc", "builtin_provider_unittest.cc", "clipboard_url_provider_unittest.cc", "history_provider_unittest.cc", "history_quick_provider_unittest.cc", "history_url_provider_unittest.cc", "in_memory_url_index_types_unittest.cc", "in_memory_url_index_unittest.cc", "keyword_provider_unittest.cc", "omnibox_edit_model_unittest.cc", "omnibox_field_trial_unittest.cc", "omnibox_popup_model_unittest.cc", "omnibox_view_unittest.cc", "physical_web_provider_unittest.cc", "scored_history_match_unittest.cc", "shortcuts_backend_unittest.cc", "shortcuts_database_unittest.cc", "shortcuts_provider_unittest.cc", "suggestion_answer_unittest.cc", "tailored_word_break_iterator_unittest.cc", "titled_url_match_utils_unittest.cc", "url_prefix_unittest.cc", "zero_suggest_provider_unittest.cc", ] deps = [ ":browser", ":test_support", ":unit_tests_bundle_data", "//base", "//components/bookmarks/browser", "//components/bookmarks/test", "//components/history/core/test", "//components/open_from_clipboard:test_support", "//components/physical_web/data_source", "//components/physical_web/data_source:test_support", "//components/prefs:test_support", "//components/search", "//components/search_engines", "//components/sessions", "//components/strings", "//components/url_formatter", "//components/variations", "//net:test_support", "//sql", "//sql:test_support", "//testing/gmock", "//testing/gtest", "//ui/base:base", "//url", ] }