Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / chrome / browser / extensions / BUILD.gn
blobee73123022e032803626c133b7114c746fd80360
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 source_set("extensions") {
19   sources = []
20   sources += rebase_path(gypi_values.chrome_browser_extensions_enabled_sources,
21                          ".",
22                          "//chrome")
24   configs += [ "//build/config:precompiled_headers" ]
25   defines = []
27   # Since browser and browser_extensions actually depend on each other,
28   # we must omit the dependency from browser_extensions to browser.
29   # However, this means browser_extensions and browser should more or less
30   # have the same dependencies. Once browser_extensions is untangled from
31   # browser, then we can clean up these dependencies.
32   public_deps = [
33     "//chrome/common/extensions/api",
34     "//content/public/browser",
35   ]
36   deps = [
37     "//chrome:extra_resources",
38     "//chrome:resources",
39     "//chrome:strings",
40     "//chrome/app/resources:platform_locale_settings",
41     "//chrome/app/theme:theme_resources",
42     "//chrome/browser/devtools",
43     "//chrome/common",
44     "//chrome/common/extensions/api:api_registration",
45     "//chrome/common/safe_browsing:proto",
46     "//chrome/installer/util",
47     "//components/copresence",
48     "//components/dom_distiller/core",
49     "//components/onc",
50     "//components/proximity_auth",
51     "//components/strings",
52     "//components/update_client",
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     "//extensions:extensions_resources",
64     "//net",
65     "//skia",
66     "//storage/common",
67     "//sync",
68     "//third_party/WebKit/public:image_resources",
69     "//third_party/WebKit/public:resources",
70     "//third_party/cacheinvalidation",
71     "//third_party/icu",
72     "//third_party/leveldatabase",
73     "//third_party/libaddressinput:util",
74     "//third_party/re2",
75     "//third_party/webrtc/modules/desktop_capture",
76     "//ui/accessibility:ax_gen",
77     "//ui/base",
78     "//ui/base/ime",
79     "//ui/gfx",
80     "//ui/gfx/geometry",
81     "//ui/resources",
82     "//ui/strings",
83     "//url",
84     "//storage/browser",
85   ]
87   if (is_chromeos) {
88     sources +=
89         rebase_path(gypi_values.chrome_browser_extensions_chromeos_sources,
90                     ".",
91                     "//chrome")
92     sources -= [ "api/music_manager_private/device_id_linux.cc" ]
93     configs += [ "//build/config/linux:dbus" ]
94     deps += [
95       "//third_party/libevent",
96       "//third_party/protobuf:protobuf_lite",
97       "//chromeos/ime:gencode",
98       "//components/chrome_apps",
99       "//remoting/host/it2me:common",
100     ]
101   } else {
102     sources += [
103       "default_apps.cc",
104       "default_apps.h'",
105     ]
106     sources +=
107         rebase_path(gypi_values.chrome_browser_extensions_non_chromeos_sources,
108                     ".",
109                     "//chrome")
110   }
112   if (use_ash) {
113     sources += [
114       "api/tabs/ash_panel_contents.cc",
115       "api/tabs/ash_panel_contents.h",
116     ]
117   }
119   if (use_aura) {
120     deps += [
121       "//ui/keyboard",
122       "//ui/keyboard:resources",
123     ]
124   }
126   if (toolkit_views) {
127     deps += [ "//ui/views" ]
128   }
130   if (is_linux) {
131     configs += [ "//build/config/linux:fontconfig" ]
132     deps += [ "//dbus" ]
133     if (use_x11) {
134       configs += [ "//build/config/linux:x11" ]
135       deps += [
136         "//ui/events:events_base",
137         "//ui/events/platform",
138         "//ui/events/platform/x11",
139       ]
140     }
141   }
143   if (enable_configuration_policy) {
144     deps += [ "//components/policy" ]
145     sources += [
146       "policy_handlers.cc",
147       "policy_handlers.h",
148     ]
149     sources += rebase_path(gypi_values.chrome_browser_extensions_policy_sources,
150                            ".",
151                            "//chrome")
152   }
154   if (enable_webrtc) {
155     sources += [ "api/webrtc_logging_private/webrtc_logging_private_api.cc" ]
156   } else {
157     sources +=
158         [ "api/webrtc_logging_private/webrtc_logging_private_api_stub.cc" ]
159   }
161   if (use_brlapi) {
162     deps += [ "//build/config/linux:libbrlapi" ]
163     sources += rebase_path(gypi_values.chrome_browser_extensions_brlapi_sources,
164                            ".",
165                            "//chrome")
166   } else {
167     sources += [ "api/braille_display_private/braille_controller_stub.cc" ]
168   }
170   # chromeos uses its own global_shortcut_listener, _x11 is not necessary.
171   if (is_chromeos || !use_x11) {
172     sources -= [
173       "global_shortcut_listener_x11.cc",
174       "global_shortcut_listener_x11.h",
175     ]
176   }
178   if (is_win || is_mac) {
179     deps += [ "//components/wifi" ]
180     sources += rebase_path(
181             gypi_values.chrome_browser_extensions_networking_private_sources_winmac,
182             ".",
183             "//chrome")
184   }
186   if (is_win) {
187     deps += [
188       "//third_party/iaccessible2",
189       "//third_party/isimpledom",
190     ]
191   } else if (use_aura && !is_chromeos) {
192     sources += [
193       "display_info_provider_aura.cc",
194       "display_info_provider_aura.h",
195     ]
196   }
198   if (enable_app_list) {
199     sources +=
200         rebase_path(gypi_values.chrome_browser_extensions_app_list_sources,
201                     ".",
202                     "//chrome")
203   }
205   if (is_chromeos && use_ozone) {
206     sources -= [ "global_shortcut_listener_chromeos.cc" ]
207   }
208   if (!use_ozone) {
209     sources -= [ "global_shortcut_listener_ozone.cc" ]
210   }