Roll src/third_party/WebKit f298044:aa8346d (svn 202628:202629)
[chromium-blink-merge.git] / chrome / browser / extensions / BUILD.gn
blob771a5e20de8c38e95d412dcd951e6674dcc38bc8
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/protobuf:protobuf_lite",
96       "//chromeos/ime:gencode",
97       "//components/chrome_apps",
98       "//remoting/host/it2me:common",
99     ]
100   } else {
101     sources += [
102       "default_apps.cc",
103       "default_apps.h'",
104     ]
105     sources +=
106         rebase_path(gypi_values.chrome_browser_extensions_non_chromeos_sources,
107                     ".",
108                     "//chrome")
109   }
111   if (use_ash) {
112     sources += [
113       "api/tabs/ash_panel_contents.cc",
114       "api/tabs/ash_panel_contents.h",
115     ]
116   }
118   if (use_aura) {
119     deps += [
120       "//ui/keyboard",
121       "//ui/keyboard:resources",
122     ]
123   }
125   if (toolkit_views) {
126     deps += [ "//ui/views" ]
127   }
129   if (is_linux) {
130     configs += [ "//build/config/linux:fontconfig" ]
131     deps += [ "//dbus" ]
132     if (use_x11) {
133       configs += [ "//build/config/linux:x11" ]
134       deps += [
135         "//ui/events:events_base",
136         "//ui/events/platform",
137         "//ui/events/platform/x11",
138       ]
139     }
140   }
142   if (enable_configuration_policy) {
143     deps += [ "//components/policy" ]
144     sources += [
145       "policy_handlers.cc",
146       "policy_handlers.h",
147     ]
148     sources += rebase_path(gypi_values.chrome_browser_extensions_policy_sources,
149                            ".",
150                            "//chrome")
151   }
153   if (enable_webrtc) {
154     sources += [ "api/webrtc_logging_private/webrtc_logging_private_api.cc" ]
155   } else {
156     sources +=
157         [ "api/webrtc_logging_private/webrtc_logging_private_api_stub.cc" ]
158   }
160   if (use_brlapi) {
161     deps += [ "//build/linux:libbrlapi" ]
162     sources += rebase_path(gypi_values.chrome_browser_extensions_brlapi_sources,
163                            ".",
164                            "//chrome")
165   } else {
166     sources += [ "api/braille_display_private/braille_controller_stub.cc" ]
167   }
169   # chromeos uses its own global_shortcut_listener, _x11 is not necessary.
170   if (is_chromeos || !use_x11) {
171     sources -= [
172       "global_shortcut_listener_x11.cc",
173       "global_shortcut_listener_x11.h",
174     ]
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 (use_aura && !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   }