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
5import("//build/config/crypto.gni")
6import("//build/config/features.gni")
7import("//build/config/ui.gni")
8
9gypi_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
16static_library("extensions") {
17  sources = []
18  sources += rebase_path(
19      gypi_values.chrome_browser_extensions_enabled_sources,
20      ".", "//chrome")
21
22  defines = []
23
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  ]
80
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/input_method.gyp:gencode',  TODO(GYP)
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  }
100
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    sources += rebase_path(
109        gypi_values.chrome_browser_extensions_non_athena_sources,
110        ".", "//chrome")
111  }
112
113  if (is_linux) {
114    configs += [ "//build/config/linux:fontconfig" ]
115    deps += [ "//dbus" ]
116    if (use_x11) {
117      configs += [
118        "//build/config/linux:x11",
119      ]
120      deps += [
121        "//ui/events:events_base",
122        "//ui/events/platform",
123        "//ui/events/platform/x11",
124      ]
125    }
126  } else {
127    sources += [
128      "api/audio/audio_service.cc",
129    ]
130  }
131
132  if (enable_configuration_policy) {
133    deps += [ "//components/policy" ]
134    sources += [
135      "policy_handlers.cc",
136      "policy_handlers.h",
137    ]
138    sources += rebase_path(
139        gypi_values.chrome_browser_extensions_policy_sources,
140        ".", "//chrome")
141  }
142
143  if (enable_webrtc) {
144    sources += [
145      "api/webrtc_logging_private/webrtc_logging_private_api.cc",
146    ]
147  } else {
148    sources += [
149      "api/webrtc_logging_private/webrtc_logging_private_api_stub.cc",
150    ]
151  }
152
153  if (use_brlapi) {
154    deps += [ "//build/config/linux:libbrlapi" ]
155    sources += rebase_path(gypi_values.chrome_browser_extensions_brlapi_sources,
156                           ".", "//chrome")
157  } else {
158    sources += [
159      "api/braille_display_private/braille_controller_stub.cc",
160    ]
161  }
162
163  if (use_aura) {
164    deps += [
165      "//ui/keyboard",
166      "//ui/keyboard:resources",
167    ]
168  }
169
170  if (!use_x11) {
171    sources -= [
172      "global_shortcut_listener_x11.cc",
173      "global_shortcut_listener_x11.h",
174    ]
175  }
176
177  if (safe_browsing_mode == 1) {
178    defines += [ "FULL_SAFE_BROWSING" ]
179  }
180  if (safe_browsing_mode == 2) {
181    defines += [ "MOBILE_SAFE_BROWSING" ]
182  }
183
184  if (is_win || is_mac) {
185    deps += [ "//components/wifi" ]
186    sources += rebase_path(
187        gypi_values.chrome_browser_extensions_networking_private_sources,
188        ".", "//chrome")
189  }
190
191  if (is_win) {
192    deps += [
193      "//third_party/iaccessible2",
194      "//third_party/isimpledom",
195    ]
196  } else if (!is_chromeos) {
197    sources += [
198      "display_info_provider_aura.cc",
199      "display_info_provider_aura.h",
200    ]
201  }
202
203  if (enable_app_list) {
204    sources += rebase_path(
205        gypi_values.chrome_browser_extensions_app_list_sources,
206        ".", "//chrome")
207  }
208
209  if (!use_ozone) {
210    sources -= [
211      "global_shortcut_listener_ozone.cc",
212    ]
213  }
214}
215