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