1# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/features.gni")
6import("//tools/json_to_struct/json_to_struct.gni")
7
8static_library("search_engines") {
9  sources = [
10    "default_search_manager.cc",
11    "default_search_manager.h",
12    "keyword_table.cc",
13    "keyword_table.h",
14    "keyword_web_data_service.cc",
15    "keyword_web_data_service.h",
16    "search_engine_type.h",
17    "search_engines_pref_names.cc",
18    "search_engines_pref_names.h",
19    "search_engines_switches.cc",
20    "search_engines_switches.h",
21    "search_host_to_urls_map.cc",
22    "search_host_to_urls_map.h",
23    "search_terms_data.cc",
24    "search_terms_data.h",
25    "template_url.cc",
26    "template_url.h",
27    "template_url_data.cc",
28    "template_url_data.h",
29    "template_url_fetcher.cc",
30    "template_url_fetcher.h",
31    "template_url_id.h",
32    "template_url_parser.cc",
33    "template_url_parser.h",
34    "template_url_prepopulate_data.cc",
35    "template_url_prepopulate_data.h",
36    "template_url_service.cc",
37    "template_url_service.h",
38    "template_url_service_client.h",
39    "template_url_service_observer.h",
40    "util.cc",
41    "util.h",
42  ]
43
44  deps = [
45    ":prepopulated_engines",
46    "//base",
47    "//components/google/core/browser",
48    "//components/keyed_service/core",
49    "//components/metrics/proto",
50    "//components/pref_registry",
51    "//components/rappor",
52    "//components/strings",
53    "//components/url_fixer",
54    "//components/webdata/common",
55    "//google_apis",
56    "//net",
57    "//sql",
58    "//sync",
59    "//third_party/libxml",
60    "//ui/gfx",
61    "//url",
62  ]
63
64  if (enable_configuration_policy) {
65    sources += [
66      "default_search_policy_handler.cc",
67      "default_search_policy_handler.h",
68    ]
69    deps += [
70      "//components/policy",
71    ]
72  }
73}
74
75source_set("test_support") {
76  testonly = true
77  sources = [
78    "default_search_pref_test_util.cc",
79    "default_search_pref_test_util.h",
80    "testing_search_terms_data.cc",
81    "testing_search_terms_data.h",
82  ]
83
84  deps = [
85    ":search_engines",
86    "//testing/gtest",
87  ]
88}
89
90json_to_struct("prepopulated_engines") {
91  visibility = [ ":*" ]
92
93  source = "prepopulated_engines.json"
94  schema_file = "prepopulated_engines_schema.json"
95  namespace = "TemplateURLPrepopulateData"
96}
97