Partial componentization of //chrome/browser/history
[chromium-blink-merge.git] / chrome / browser / extensions / BUILD.gn
blob0a4584aea123494b0b75399e86dc1911fb368be0
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 =
12     exec_script("//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(gypi_values.chrome_browser_extensions_enabled_sources,
21                          ".",
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/common",
43     "//chrome/common/extensions/api:api_registration",
44     "//chrome/common/net",
45     "//chrome/common/safe_browsing:proto",
46     "//chrome/installer/util",
47     "//components/copresence",
48     "//components/history/core/browser:proto",
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 +=
85         rebase_path(gypi_values.chrome_browser_extensions_chromeos_sources,
86                     ".",
87                     "//chrome")
88     sources -= [ "api/music_manager_private/device_id_linux.cc" ]
89     configs += [ "//build/config/linux:dbus" ]
90     deps += [
91       "//third_party/libevent",
92       "//third_party/protobuf:protobuf_lite",
93       "//chromeos/ime:gencode",
94       "//remoting/host/it2me:common",
95     ]
96   } else {
97     sources += [
98       "default_apps.cc",
99       "default_apps.h'",
100     ]
101     sources +=
102         rebase_path(gypi_values.chrome_browser_extensions_non_chromeos_sources,
103                     ".",
104                     "//chrome")
105   }
107   if (use_ash) {
108     sources += [
109       "api/tabs/ash_panel_contents.cc",
110       "api/tabs/ash_panel_contents.h",
111     ]
112   }
113   if (use_athena) {
114     defines += [ USE_ATHENA ]
115     sources += rebase_path(gypi_values.chrome_browser_extensions_athena_sources,
116                            ".",
117                            "//chrome")
118   } else {
119     sources +=
120         rebase_path(gypi_values.chrome_browser_extensions_non_athena_sources,
121                     ".",
122                     "//chrome")
123   }
125   if (is_linux) {
126     configs += [ "//build/config/linux:fontconfig" ]
127     deps += [ "//dbus" ]
128     if (use_x11) {
129       configs += [ "//build/config/linux:x11" ]
130       deps += [
131         "//ui/events:events_base",
132         "//ui/events/platform",
133         "//ui/events/platform/x11",
134       ]
135     }
136   }
138   if (enable_configuration_policy) {
139     deps += [ "//components/policy" ]
140     sources += [
141       "policy_handlers.cc",
142       "policy_handlers.h",
143     ]
144     sources += rebase_path(gypi_values.chrome_browser_extensions_policy_sources,
145                            ".",
146                            "//chrome")
147   }
149   if (enable_webrtc) {
150     sources += [ "api/webrtc_logging_private/webrtc_logging_private_api.cc" ]
151   } else {
152     sources +=
153         [ "api/webrtc_logging_private/webrtc_logging_private_api_stub.cc" ]
154   }
156   if (use_brlapi) {
157     deps += [ "//build/config/linux:libbrlapi" ]
158     sources += rebase_path(gypi_values.chrome_browser_extensions_brlapi_sources,
159                            ".",
160                            "//chrome")
161   } else {
162     sources += [ "api/braille_display_private/braille_controller_stub.cc" ]
163   }
165   if (use_aura) {
166     deps += [
167       "//ui/keyboard",
168       "//ui/keyboard:resources",
169     ]
170   }
172   # chromeos uses its own global_shortcut_listener, _x11 is not necessary.
173   if (is_chromeos || !use_x11) {
174     sources -= [
175       "global_shortcut_listener_x11.cc",
176       "global_shortcut_listener_x11.h",
177     ]
178   }
180   if (safe_browsing_mode == 1) {
181     defines += [ "FULL_SAFE_BROWSING" ]
182   }
183   if (safe_browsing_mode == 2) {
184     defines += [ "MOBILE_SAFE_BROWSING" ]
185   }
187   if (is_win || is_mac) {
188     deps += [ "//components/wifi" ]
189     sources += rebase_path(
190             gypi_values.chrome_browser_extensions_networking_private_sources_winmac,
191             ".",
192             "//chrome")
193   }
195   if (is_desktop_linux) {
196     sources += rebase_path(
197             gypi_values.chrome_browser_extensions_networking_private_sources_linux,
198             ".",
199             "//chrome")
200   }
202   if (is_win) {
203     deps += [
204       "//third_party/iaccessible2",
205       "//third_party/isimpledom",
206     ]
207   } else if (!is_chromeos) {
208     sources += [
209       "display_info_provider_aura.cc",
210       "display_info_provider_aura.h",
211     ]
212   }
214   if (enable_app_list) {
215     sources +=
216         rebase_path(gypi_values.chrome_browser_extensions_app_list_sources,
217                     ".",
218                     "//chrome")
219   }
221   if (is_chromeos && use_ozone) {
222     sources -= [ "global_shortcut_listener_chromeos.cc" ]
223   }
224   if (!use_ozone) {
225     sources -= [ "global_shortcut_listener_ozone.cc" ]
226   }