Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / components / search_engines / BUILD.gn
blob4c555bdbdc86569f23203a1222b6319aa58757b1
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.
5 import("//build/config/features.gni")
6 import("//tools/json_to_struct/json_to_struct.gni")
8 static_library("search_engines") {
9   sources = [
10     "default_search_manager.cc",
11     "default_search_manager.h",
12     "default_search_pref_migration.cc",
13     "default_search_pref_migration.h",
14     "keyword_table.cc",
15     "keyword_table.h",
16     "keyword_web_data_service.cc",
17     "keyword_web_data_service.h",
18     "search_engine_type.h",
19     "search_engines_pref_names.cc",
20     "search_engines_pref_names.h",
21     "search_engines_switches.cc",
22     "search_engines_switches.h",
23     "search_host_to_urls_map.cc",
24     "search_host_to_urls_map.h",
25     "search_terms_data.cc",
26     "search_terms_data.h",
27     "template_url.cc",
28     "template_url.h",
29     "template_url_data.cc",
30     "template_url_data.h",
31     "template_url_fetcher.cc",
32     "template_url_fetcher.h",
33     "template_url_id.h",
34     "template_url_parser.cc",
35     "template_url_parser.h",
36     "template_url_prepopulate_data.cc",
37     "template_url_prepopulate_data.h",
38     "template_url_service.cc",
39     "template_url_service.h",
40     "template_url_service_client.h",
41     "template_url_service_observer.h",
42     "util.cc",
43     "util.h",
44   ]
46   public_deps = [
47     "//components/metrics/proto",
48   ]
50   deps = [
51     ":prepopulated_engines",
52     "//base",
53     "//components/google/core/browser",
54     "//components/history/core/browser",
55     "//components/keyed_service/core",
56     "//components/metrics/proto",
57     "//components/pref_registry",
58     "//components/rappor",
59     "//components/strings",
60     "//components/url_formatter",
61     "//components/webdata/common",
62     "//google_apis",
63     "//net",
64     "//sql",
65     "//sync",
66     "//third_party/libxml",
67     "//ui/gfx",
68     "//url",
69   ]
71   if (enable_configuration_policy) {
72     sources += [
73       "default_search_policy_handler.cc",
74       "default_search_policy_handler.h",
75     ]
76     deps += [ "//components/policy" ]
77   }
80 source_set("test_support") {
81   testonly = true
82   sources = [
83     "default_search_pref_test_util.cc",
84     "default_search_pref_test_util.h",
85     "testing_search_terms_data.cc",
86     "testing_search_terms_data.h",
87   ]
89   public_deps = [
90     ":search_engines",
91     "//testing/gtest",
92   ]
95 source_set("unit_tests") {
96   testonly = true
97   sources = [
98     "default_search_manager_unittest.cc",
99     "default_search_policy_handler_unittest.cc",
100     "default_search_pref_migration_unittest.cc",
101     "keyword_table_unittest.cc",
102     "search_host_to_urls_map_unittest.cc",
103     "template_url_prepopulate_data_unittest.cc",
104     "template_url_service_util_unittest.cc",
105     "template_url_unittest.cc",
106   ]
107   deps = [
108     ":test_support",
109     "//testing/gmock",
110     "//testing/gtest",
111   ]
114 json_to_struct("prepopulated_engines") {
115   visibility = [ ":*" ]
117   source = "prepopulated_engines.json"
118   schema_file = "prepopulated_engines_schema.json"
119   namespace = "TemplateURLPrepopulateData"