Add ENABLE_MEDIA_ROUTER define to builds other than Android and iOS.
[chromium-blink-merge.git] / chrome / browser / extensions / BUILD.gn
blobdd898270262a438ecd8b135b88df793b0dc1b276
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/onc",
49     "//components/proximity_auth",
50     "//components/strings",
51     "//components/update_client",
52     "//components/url_matcher",
53     "//content/app/resources",
54     "//content/public/common",
55     "//crypto",
56     "//device/bluetooth",
57     "//device/hid",
58     "//extensions/browser",
59     "//extensions/common/api",
60     "//extensions/common/api:api_registration",
61     "//extensions/strings",
62     "//net",
63     "//skia",
64     "//storage/common",
65     "//sync",
66     "//third_party/WebKit/public:image_resources",
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/base/ime",
76     "//ui/gfx",
77     "//ui/gfx/geometry",
78     "//ui/resources",
79     "//ui/strings",
80     "//url",
81     "//storage/browser",
82   ]
84   if (is_chromeos) {
85     sources +=
86         rebase_path(gypi_values.chrome_browser_extensions_chromeos_sources,
87                     ".",
88                     "//chrome")
89     sources -= [ "api/music_manager_private/device_id_linux.cc" ]
90     configs += [ "//build/config/linux:dbus" ]
91     deps += [
92       "//third_party/libevent",
93       "//third_party/protobuf:protobuf_lite",
94       "//chromeos/ime:gencode",
95       "//remoting/host/it2me:common",
96     ]
97   } else {
98     sources += [
99       "default_apps.cc",
100       "default_apps.h'",
101     ]
102     sources +=
103         rebase_path(gypi_values.chrome_browser_extensions_non_chromeos_sources,
104                     ".",
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   }
115   if (is_linux) {
116     configs += [ "//build/config/linux:fontconfig" ]
117     deps += [ "//dbus" ]
118     if (use_x11) {
119       configs += [ "//build/config/linux:x11" ]
120       deps += [
121         "//ui/events:events_base",
122         "//ui/events/platform",
123         "//ui/events/platform/x11",
124       ]
125     }
126   }
128   if (enable_configuration_policy) {
129     deps += [ "//components/policy" ]
130     sources += [
131       "policy_handlers.cc",
132       "policy_handlers.h",
133     ]
134     sources += rebase_path(gypi_values.chrome_browser_extensions_policy_sources,
135                            ".",
136                            "//chrome")
137   }
139   if (enable_webrtc) {
140     sources += [ "api/webrtc_logging_private/webrtc_logging_private_api.cc" ]
141   } else {
142     sources +=
143         [ "api/webrtc_logging_private/webrtc_logging_private_api_stub.cc" ]
144   }
146   if (use_brlapi) {
147     deps += [ "//build/config/linux:libbrlapi" ]
148     sources += rebase_path(gypi_values.chrome_browser_extensions_brlapi_sources,
149                            ".",
150                            "//chrome")
151   } else {
152     sources += [ "api/braille_display_private/braille_controller_stub.cc" ]
153   }
155   if (use_aura) {
156     deps += [
157       "//ui/keyboard",
158       "//ui/keyboard:resources",
159     ]
160   }
162   # chromeos uses its own global_shortcut_listener, _x11 is not necessary.
163   if (is_chromeos || !use_x11) {
164     sources -= [
165       "global_shortcut_listener_x11.cc",
166       "global_shortcut_listener_x11.h",
167     ]
168   }
170   if (safe_browsing_mode == 1) {
171     defines += [ "FULL_SAFE_BROWSING" ]
172   }
173   if (safe_browsing_mode == 2) {
174     defines += [ "MOBILE_SAFE_BROWSING" ]
175   }
177   if (is_win || is_mac) {
178     deps += [ "//components/wifi" ]
179     sources += rebase_path(
180             gypi_values.chrome_browser_extensions_networking_private_sources_winmac,
181             ".",
182             "//chrome")
183   }
185   if (is_win) {
186     deps += [
187       "//third_party/iaccessible2",
188       "//third_party/isimpledom",
189     ]
190   } else if (!is_chromeos) {
191     sources += [
192       "display_info_provider_aura.cc",
193       "display_info_provider_aura.h",
194     ]
195   }
197   if (enable_app_list) {
198     sources +=
199         rebase_path(gypi_values.chrome_browser_extensions_app_list_sources,
200                     ".",
201                     "//chrome")
202   }
204   if (is_chromeos && use_ozone) {
205     sources -= [ "global_shortcut_listener_chromeos.cc" ]
206   }
207   if (!use_ozone) {
208     sources -= [ "global_shortcut_listener_ozone.cc" ]
209   }