Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / BUILD.gn
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.
4
5 import("//build/config/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
8
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" ])
14
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")
21
22   defines = []
23
24   # TODO(GYP) remove this when webrtc is ported.
25   configs += [ "//content:webrtc_stub_config" ]
26
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   deps = [
33     "//chrome:extra_resources",
34     "//chrome:resources",
35     "//chrome:strings",
36     "//chrome/app/resources:platform_locale_settings",
37     "//chrome/app/theme:theme_resources",
38     "//chrome/browser/history:in_memory_url_index_cache_proto",
39     "//chrome/browser/sync_file_system:sync_file_system_proto",
40     "//chrome/common",
41     "//chrome/common/extensions/api",
42     "//chrome/common/net",
43     "//chrome/common/safe_browsing:proto",
44     "//components/onc",
45     "//components/strings",
46     "//components/url_matcher",
47     "//content/public/browser",
48     "//content/public/common",
49     "//crypto",
50     "//extensions/common/api",
51     "//extensions/strings",
52     "//net",
53     "//skia",
54     "//sync",
55     "//third_party/WebKit/public:resources",
56     "//third_party/cacheinvalidation",
57     "//third_party/icu",
58     "//third_party/leveldatabase",
59     "//third_party/re2",
60     "//ui/accessibility:ax_gen",
61     "//ui/base",
62     "//ui/gfx",
63     "//ui/gfx/geometry",
64     "//ui/resources",
65     "//ui/strings",
66     "//url",
67     "//webkit/browser:storage",
68     "//webkit/common:storage",
69     "//webkit/glue/resources",
70     #"debugger",  TODO(GYP)
71     #"installer_util",  TODO(GYP)
72     #"../components/components.gyp:omaha_query_params",  TODO(GYP)
73     #'../device/bluetooth/bluetooth.gyp:device_bluetooth',  TODO(GYP)
74     #"../device/hid/hid.gyp:device_hid",  TODO(GYP)
75     #"../extensions/extensions.gyp:extensions_browser",  TODO(GYP)
76     #"../third_party/webrtc/modules/modules.gyp:desktop_capture",  TODO(GYP)
77   ]
78
79   forward_dependent_configs_from = [
80     "//chrome/common/extensions/api",
81     "//content/public/browser",
82   ]
83
84   if (is_chromeos) {
85     sources += rebase_path(
86         gypi_values.chrome_browser_extensions_chromeos_sources,
87         ".", "//chrome")
88     configs += [ "//build/config/linux:dbus" ]
89     deps += [
90       "//third_party/libevent",
91       "//third_party/protobuf:protobuf_lite",
92       #'../chromeos/ime/input_method.gyp:gencode',  TODO(GYP)
93     ]
94   } else {
95     sources += [
96       "default_apps.cc",
97       "default_apps.h'"
98     ]
99     sources += rebase_path(
100         gypi_values.chrome_browser_extensions_non_chromeos_sources,
101         ".", "//chrome")
102   }
103
104   if (use_ash) {
105     sources += [
106       "api/tabs/ash_panel_contents.cc",
107       "api/tabs/ash_panel_contents.h",
108     ]
109   }
110
111   if (is_linux) {
112     configs += [ "//build/config/linux:fontconfig" ]
113     deps += [ "//dbus" ]
114     if (use_x11) {
115       configs += [
116         "//build/config/linux:x11",
117       ]
118       deps += [
119         "//ui/events/platform",
120         "//ui/events/platform/x11",
121       ]
122     }
123   } else {
124     sources += [
125       "api/audio/audio_service.cc",
126     ]
127   }
128
129   if (enable_configuration_policy) {
130     deps += [ "//components/policy" ]
131     sources += [
132       "policy_handlers.cc",
133       "policy_handlers.h",
134     ]
135     sources += rebase_path(
136         gypi_values.chrome_browser_extensions_policy_sources,
137         ".", "//chrome")
138   }
139
140   if (enable_webrtc) {
141     sources += [
142       "api/webrtc_logging_private/webrtc_logging_private_api.cc",
143     ]
144   } else {
145     sources += [
146       "api/webrtc_logging_private/webrtc_logging_private_api_stub.cc",
147     ]
148   }
149
150   if (use_brlapi) {
151     deps += [ "//build/config/linux:libbrlapi" ]
152     sources += rebase_path(gypi_values.chrome_browser_extensions_brlapi_sources,
153                            ".", "//chrome")
154   } else {
155     sources += [
156       "api/braille_display_private/braille_controller_stub.cc",
157     ]
158   }
159
160   if (use_aura) {
161     deps += [
162       "//ui/keyboard",
163       "//ui/keyboard:resources",
164     ]
165   }
166
167   if (!use_x11) {
168     sources -= [
169       "global_shortcut_listener_x11.cc",
170       "global_shortcut_listener_x11.h",
171     ]
172   }
173
174   if (safe_browsing_mode == 1) {
175     defines += [ "FULL_SAFE_BROWSING" ]
176   }
177   if (safe_browsing_mode == 2) {
178     defines += [ "MOBILE_SAFE_BROWSING" ]
179   }
180
181   if (is_win || is_mac) {
182     deps += [ "//components/wifi" ]
183     sources += rebase_path(
184         gypi_values.chrome_browser_extensions_networking_private_sources,
185         ".", "//chrome")
186   }
187
188   if (is_win) {
189     deps += [
190       "//third_party/iaccessible2",
191       "//third_party/isimpledom",
192     ]
193   } else if (!is_chromeos) {
194     sources += [ "api/system_display/display_info_provider_aura.cc" ]
195   }
196
197   if (enable_app_list) {
198     sources += rebase_path(
199         gypi_values.chrome_browser_extensions_app_list_sources,
200         ".", "//chrome")
201   }
202
203   if (!use_ozone) {
204     sources -= [
205       "global_shortcut_listener_ozone.cc",
206     ]
207   }
208 }