Rename components/omaha_query_params => components/omaha_client
[chromium-blink-merge.git] / chrome / browser / extensions / BUILD.gn
blob57cf686270d6c34dcba5b7805d8fe671512279e3
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/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
9 assert(enable_extensions)
11 gypi_values = exec_script(
12     "//build/gypi_to_gn.py",
13     [ rebase_path("../../chrome_browser_extensions.gypi") ],
14     "scope",
15     [ "../../chrome_browser_extensions.gypi" ])
17 # GYP version: chrome/chrome_browser_extensions.gypi:browser_extensions
18 static_library("extensions") {
19   sources = []
20   sources += rebase_path(
21       gypi_values.chrome_browser_extensions_enabled_sources,
22       ".", "//chrome")
24   defines = []
26   # Since browser and browser_extensions actually depend on each other,
27   # we must omit the dependency from browser_extensions to browser.
28   # However, this means browser_extensions and browser should more or less
29   # have the same dependencies. Once browser_extensions is untangled from
30   # browser, then we can clean up these dependencies.
31   public_deps = [
32     "//chrome/common/extensions/api",
33     "//content/public/browser",
34   ]
35   deps = [
36     "//chrome:extra_resources",
37     "//chrome:resources",
38     "//chrome:strings",
39     "//chrome/app/resources:platform_locale_settings",
40     "//chrome/app/theme:theme_resources",
41     "//chrome/browser/devtools",
42     "//chrome/browser/history:in_memory_url_index_cache_proto",
43     "//chrome/common",
44     "//chrome/common/extensions/api:api_registration",
45     "//chrome/common/net",
46     "//chrome/common/safe_browsing:proto",
47     "//chrome/installer/util",
48     "//components/copresence",
49     "//components/omaha_client",
50     "//components/onc",
51     "//components/proximity_auth",
52     "//components/strings",
53     "//components/url_matcher",
54     "//content/app/resources",
55     "//content/public/common",
56     "//crypto",
57     "//device/bluetooth",
58     "//device/hid",
59     "//extensions/browser",
60     "//extensions/common/api",
61     "//extensions/common/api:api_registration",
62     "//extensions/strings",
63     "//net",
64     "//skia",
65     "//storage/common",
66     "//sync",
67     "//third_party/WebKit/public:resources",
68     "//third_party/cacheinvalidation",
69     "//third_party/icu",
70     "//third_party/leveldatabase",
71     "//third_party/re2",
72     "//third_party/webrtc/modules/desktop_capture",
73     "//ui/accessibility:ax_gen",
74     "//ui/base",
75     "//ui/gfx",
76     "//ui/gfx/geometry",
77     "//ui/resources",
78     "//ui/strings",
79     "//url",
80     "//storage/browser",
81   ]
83   if (is_chromeos) {
84     sources += rebase_path(
85         gypi_values.chrome_browser_extensions_chromeos_sources,
86         ".", "//chrome")
87     sources -= [
88       "api/audio/audio_service_linux.cc",
89       "api/music_manager_private/device_id_linux.cc",
90     ]
91     configs += [ "//build/config/linux:dbus" ]
92     deps += [
93       "//third_party/libevent",
94       "//third_party/protobuf:protobuf_lite",
95       "//chromeos/ime:gencode",
96       "//remoting/host/it2me:common",
97     ]
98   } else {
99     sources += [
100       "default_apps.cc",
101       "default_apps.h'"
102     ]
103     sources += rebase_path(
104         gypi_values.chrome_browser_extensions_non_chromeos_sources,
105         ".", "//chrome")
106   }
108   if (use_ash) {
109     sources += [
110       "api/tabs/ash_panel_contents.cc",
111       "api/tabs/ash_panel_contents.h",
112     ]
113   }
114   if (use_athena) {
115     defines += [ USE_ATHENA ]
116     sources += rebase_path(
117       gypi_values.chrome_browser_extensions_athena_sources,
118         ".", "//chrome")
119   } else {
120     sources += rebase_path(
121       gypi_values.chrome_browser_extensions_non_athena_sources,
122         ".", "//chrome")
123   }
125   if (is_linux) {
126     configs += [ "//build/config/linux:fontconfig" ]
127     deps += [ "//dbus" ]
128     if (use_x11) {
129       configs += [
130         "//build/config/linux:x11",
131       ]
132       deps += [
133         "//ui/events:events_base",
134         "//ui/events/platform",
135         "//ui/events/platform/x11",
136       ]
137     }
138   } else {
139     sources += [
140       "api/audio/audio_service.cc",
141     ]
142   }
144   if (enable_configuration_policy) {
145     deps += [ "//components/policy" ]
146     sources += [
147       "policy_handlers.cc",
148       "policy_handlers.h",
149     ]
150     sources += rebase_path(
151         gypi_values.chrome_browser_extensions_policy_sources,
152         ".", "//chrome")
153   }
155   if (enable_webrtc) {
156     sources += [
157       "api/webrtc_logging_private/webrtc_logging_private_api.cc",
158     ]
159   } else {
160     sources += [
161       "api/webrtc_logging_private/webrtc_logging_private_api_stub.cc",
162     ]
163   }
165   if (use_brlapi) {
166     deps += [ "//build/config/linux:libbrlapi" ]
167     sources += rebase_path(gypi_values.chrome_browser_extensions_brlapi_sources,
168                            ".", "//chrome")
169   } else {
170     sources += [
171       "api/braille_display_private/braille_controller_stub.cc",
172     ]
173   }
175   if (use_aura) {
176     deps += [
177       "//ui/keyboard",
178       "//ui/keyboard:resources",
179     ]
180   }
182   # chromeos uses its own global_shortcut_listener, _x11 is not necessary.
183   if (is_chromeos || !use_x11) {
184     sources -= [
185       "global_shortcut_listener_x11.cc",
186       "global_shortcut_listener_x11.h",
187     ]
188   }
190   if (safe_browsing_mode == 1) {
191     defines += [ "FULL_SAFE_BROWSING" ]
192   }
193   if (safe_browsing_mode == 2) {
194     defines += [ "MOBILE_SAFE_BROWSING" ]
195   }
197   if (is_win || is_mac) {
198     deps += [ "//components/wifi" ]
199     sources += rebase_path(
200         gypi_values.chrome_browser_extensions_networking_private_sources_winmac,
201         ".", "//chrome")
202   }
204   if (is_desktop_linux) {
205     sources += rebase_path(
206         gypi_values.chrome_browser_extensions_networking_private_sources_linux,
207         ".", "//chrome")
208   }
210   if (is_win) {
211     deps += [
212       "//third_party/iaccessible2",
213       "//third_party/isimpledom",
214     ]
215   } else if (!is_chromeos) {
216     sources += [
217       "display_info_provider_aura.cc",
218       "display_info_provider_aura.h",
219     ]
220   }
222   if (enable_app_list) {
223     sources += rebase_path(
224         gypi_values.chrome_browser_extensions_app_list_sources,
225         ".", "//chrome")
226   }
228   if (is_chromeos && use_ozone) {
229     sources -= [
230       "global_shortcut_listener_chromeos.cc",
231     ]
232     deps -= [
233       "//remoting/host/it2me:common",
234     ]
235   }
236   if (!use_ozone) {
237     sources -= [
238       "global_shortcut_listener_ozone.cc",
239     ]
240   }