# 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("//third_party/protobuf/proto_library.gni") import("//components/vector_icons/vector_icons.gni") if (is_android) { import("//build/config/android/rules.gni") } aggregate_vector_icons("omnibox_vector_icons") { icon_directory = "vector_icons" icons = [ "calculator.1x.icon", "calculator.icon", "extension_app.1x.icon", "extension_app.icon", "http.icon", "keyword_search.icon", "star.1x.icon", "star.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", "builtin_provider.cc", "builtin_provider.h", "clipboard_url_provider.cc", "clipboard_url_provider.h", "contextual_suggestions_service.cc", "contextual_suggestions_service.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/metrics/proto", "//components/omnibox/common", ] deps = [ ":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 && !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_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/metrics/proto", "//components/search_engines", "//net", "//testing/gmock", "//testing/gtest", "//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_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_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_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", "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/toolbar:test_support", "//components/url_formatter", "//components/variations", "//net:test_support", "//sql", "//sql:test_support", "//testing/gmock", "//testing/gtest", "//ui/base:base", "//url", ] }