Ensure that by default PDFs are opened in Chrome.
[chromium-blink-merge.git] / extensions / shell / BUILD.gn
blobb7bf9ce833d35376462a3acebd723115d3568b24
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("//extensions/shell/app_shell.gni")
7 # Technically, this directory should not depend on files from src/chrome, but
8 # that's where the VERSION file is. This  should probably all be moved to
9 # src/build.
10 import("//chrome/version.gni")
11 import("//testing/test.gni")
12 import("//tools/grit/grit_rule.gni")
14 assert(enable_extensions)
16 grit("resources") {
17   source = "app_shell_resources.grd"
18   outputs = [
19     "grit/app_shell_resources.h",
20     "app_shell_resources.pak",
21   ]
24 source_set("app_shell_lib") {
25   # TODO(jamescook): investigate and get rid of test dependencies. This library
26   # is testonly because it depends on testonly libraries, namely
27   # //content/shell:content_shell_lib. See http://crbug.com/438283
28   testonly = true
29   deps = [
30     ":resources",
31     ":version_header",
32     "//base",
33     "//base:prefs",
34     "//components/devtools_discovery",
35     "//components/devtools_http_handler",
36     "//components/pref_registry",
37     "//components/update_client",
38     "//components/user_prefs",
39     "//components/web_cache/renderer",
40     "//content",
41     "//content/shell:content_shell_lib",
42     "//device/core",
43     "//device/hid",
44     "//extensions/common/api",
45     "//extensions/common/api:api_registration",
46     "//extensions/browser",
47     "//extensions/common",
48     "//extensions/renderer",
49     "//extensions/shell/common/api",
50     "//extensions/shell/common/api:api_registration",
51     "//extensions/utility",
52     "//extensions:extensions_resources",
53     "//extensions:shell_and_test_pak",
54     "//mojo/environment:chromium",
55     "//skia",
56     "//third_party/WebKit/public:blink",
57     "//third_party/mojo/src/mojo/edk/system",
58     "//ui/base",
59     "//ui/base/ime",
60     "//v8",
61   ]
63   sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources,
64                         ".",
65                         "//extensions/shell")
67   if (use_aura) {
68     deps += [ "//ui/wm" ]
70     aura_sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources_aura,
71                                ".",
72                                "//extensions/shell")
73     sources += aura_sources
74   }
76   if (is_chromeos) {
77     deps += [
78       "//chromeos",
79       "//ui/chromeos:ui_chromeos",
80       "//ui/display",
81     ]
82     chromeos_sources =
83         rebase_path(app_shell_gypi_values.app_shell_lib_sources_chromeos,
84                     ".",
85                     "//extensions/shell")
86     sources += chromeos_sources
87   }
89   # TODO(GYP): Enable this when //components/nacl GN is done. See
90   # http://crbug.com/430602
91   if (false) {
92     if (enable_nacl) {
93       if (is_linux) {
94         deps += [ "//components/nacl:nacl_helper" ]
95       }
96       deps += [
97         "//components/nacl",
98         "//components/nacl:browser",
99         "//components/nacl:common",
100         "//components/nacl:renderer",
101         "//components/nacl:switches",
102       ]
103       nacl_sources =
104           rebase_path(app_shell_gypi_values.app_shell_lib_sources_nacl,
105                       ".",
106                       "//extensions/shell")
107       sources += nacl_sources
108     }
109   }
111   if (enable_nacl) {
112     sources += [
113       "browser/shell_nacl_browser_delegate.cc",
114       "browser/shell_nacl_browser_delegate.h",
115     ]
117     deps += [
118       "//components/nacl",
119       "//components/nacl:nacl_browser",
120       "//components/nacl:nacl_common",
121       "//components/nacl:nacl_renderer",
122       "//components/nacl:nacl_switches",
123       "//components/nacl/renderer/plugin:nacl_trusted_plugin",
124     ]
126     if (is_linux) {
127       deps += [ "//components/nacl:nacl_helper" ]
128     }
129   }
132 if (!(is_chromeos && !use_ozone)) {
133   executable("app_shell") {
134     # testonly because :app_shell_lib is testonly. See :app_shell_lib comment.
135     testonly = true
136     sources = rebase_path(app_shell_gypi_values.app_shell_sources,
137                           ".",
138                           "//extensions/shell")
139     deps = [
140       ":app_shell_lib",
141       "//extensions:shell_and_test_pak",
142     ]
144     if (is_win) {
145       configs += [ "//build/config/win:windowed" ]
146       configs -= [ "//build/config/win:console" ]
147       deps += [ "//base/allocator" ]
148     }
150     if (is_mac) {
151       # TODO(GYP): Mac bundling
152     }
153   }
156 test("app_shell_unittests") {
157   sources = rebase_path(app_shell_gypi_values.app_shell_unittests_sources,
158                         ".",
159                         "//extensions/shell")
161   deps = [
162     ":app_shell_lib",
163     "//base",
164     "//base/test:test_support",
165     "//content/test:test_support",
166     "//extensions:shell_and_test_pak",
167     "//extensions:test_support",
168     "//testing/gtest",
169   ]
171   if (use_aura) {
172     deps += [ "//ui/aura:test_support" ]
174     aura_sources =
175         rebase_path(app_shell_gypi_values.app_shell_unittests_sources_aura,
176                     ".",
177                     "//extensions/shell")
178     sources += aura_sources
179   }
181   if (is_chromeos) {
182     deps += [ "//chromeos:test_support_without_gmock" ]
184     chromeos_sources =
185         rebase_path(app_shell_gypi_values.app_shell_unittests_sources_chromeos,
186                     ".",
187                     "//extensions/shell")
188     sources += chromeos_sources
189   }
191   # TODO(GYP): Enable this when //components/nacl GN is done.
192   if (false) {
193     if (use_nacl) {
194       nacl_sources =
195           rebase_path(app_shell_gypi_values.app_shell_unittests_sources_nacl,
196                       ".",
197                       "//extensions/shell")
198       sources += nacl_sources
199     }
200   }
202   if (is_win) {
203     deps += [ "//base/allocator" ]
204   }
207 process_version("version_header") {
208   template_file = "common/version.h.in"
209   output = "$target_gen_dir/common/version.h"