Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / ui / message_center / BUILD.gn
blob1e4095a831460424d59e68d552b49313ce8e582e
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/features.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
9 component("message_center") {
10   deps = [
11     "//base",
12     "//base:i18n",
13     "//base/third_party/dynamic_annotations",
14     "//components/url_formatter",
15     "//skia",
16     "//ui/accessibility",
17     "//ui/base",
18     "//ui/events",
19     "//ui/gfx",
20     "//ui/gfx/geometry",
21     "//ui/native_theme",
22     "//ui/resources",
23     "//ui/strings",
24     "//url",
25   ]
27   configs += [
28     "//build/config:precompiled_headers",
30     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
31     "//build/config/compiler:no_size_t_to_int_warning",
32   ]
34   defines = [ "MESSAGE_CENTER_IMPLEMENTATION" ]
36   if (enable_notifications && !is_android) {
37     sources = [
38       "cocoa/notification_controller.h",
39       "cocoa/notification_controller.mm",
40       "cocoa/opaque_views.h",
41       "cocoa/opaque_views.mm",
42       "cocoa/popup_collection.h",
43       "cocoa/popup_collection.mm",
44       "cocoa/popup_controller.h",
45       "cocoa/popup_controller.mm",
46       "message_center.cc",
47       "message_center.h",
48       "message_center_export.h",
49       "message_center_impl.cc",
50       "message_center_impl.h",
51       "message_center_observer.h",
52       "message_center_style.cc",
53       "message_center_style.h",
54       "message_center_switches.cc",
55       "message_center_switches.h",
56       "message_center_tray.cc",
57       "message_center_tray.h",
58       "message_center_tray_delegate.h",
59       "message_center_types.h",
60       "notification.cc",
61       "notification.h",
62       "notification_blocker.cc",
63       "notification_blocker.h",
64       "notification_delegate.cc",
65       "notification_delegate.h",
66       "notification_list.cc",
67       "notification_list.h",
68       "notification_types.cc",
69       "notification_types.h",
70       "notifier_settings.cc",
71       "notifier_settings.h",
72     ]
74     if (is_win) {
75       deps += [ "//ui/aura" ]
76     }
78     # On Mac, toolkit-views builds still use the Cocoa UI. Keep this in sync
79     # with message_center_unittests below.
80     if (toolkit_views && !is_mac) {
81       sources += [
82         "views/bounded_label.cc",
83         "views/bounded_label.h",
84         "views/constants.h",
85         "views/desktop_popup_alignment_delegate.cc",
86         "views/desktop_popup_alignment_delegate.h",
87         "views/message_center_button_bar.cc",
88         "views/message_center_button_bar.h",
89         "views/message_center_controller.h",
90         "views/message_center_view.cc",
91         "views/message_center_view.h",
92         "views/message_list_view.cc",
93         "views/message_list_view.h",
94         "views/message_popup_collection.cc",
95         "views/message_popup_collection.h",
96         "views/message_view.cc",
97         "views/message_view.h",
98         "views/message_view_context_menu_controller.cc",
99         "views/message_view_context_menu_controller.h",
100         "views/notification_button.cc",
101         "views/notification_button.h",
102         "views/notification_view.cc",
103         "views/notification_view.h",
104         "views/notifier_settings_view.cc",
105         "views/notifier_settings_view.h",
106         "views/padded_button.cc",
107         "views/padded_button.h",
108         "views/popup_alignment_delegate.cc",
109         "views/popup_alignment_delegate.h",
110         "views/proportional_image_view.cc",
111         "views/proportional_image_view.h",
112         "views/toast_contents_view.cc",
113         "views/toast_contents_view.h",
114       ]
115       deps += [
116         "//ui/events",
117         "//ui/views",
118         "//ui/compositor",
119       ]
120     }
122     if (use_ash) {
123       sources += [
124         "views/message_bubble_base.cc",
125         "views/message_bubble_base.h",
126         "views/message_center_bubble.cc",
127         "views/message_center_bubble.h",
128       ]
129     }
130   } else {
131     # Notification service disabled.
132     sources = [
133       "dummy_message_center.cc",
134       "notification_delegate.cc",
135       "notification_delegate.h",
136     ]
138     # Android implements its own notification UI manager instead of deferring to
139     # the message center (when notifications are enabled). Include a minimal
140     # set of files required for notifications on Android.
141     if (is_android) {
142       sources += [
143         "notification.cc",
144         "notification.h",
145         "notifier_settings.cc",
146         "notifier_settings.h",
147       ]
148     }
149   }
152 static_library("test_support") {
153   testonly = true
154   sources = [
155     "fake_message_center.cc",
156     "fake_message_center.h",
157     "fake_message_center_tray_delegate.cc",
158     "fake_message_center_tray_delegate.h",
159     "fake_notifier_settings_provider.cc",
160     "fake_notifier_settings_provider.h",
161   ]
163   public_deps = [
164     ":message_center",
165   ]
167   deps = [
168     "//base",
169     "//base/test:test_support",
170     "//skia",
171     "//ui/gfx",
172     "//ui/gfx/geometry",
173   ]
176 test("message_center_unittests") {
177   sources = [
178     "test/run_all_unittests.cc",
179   ]
181   deps = [
182     ":message_center",
183     ":test_support",
184     "//base",
185     "//base/allocator",
186     "//base/test:test_support",
187     "//skia",
188     "//testing/gtest",
189     "//ui/base",
190     "//ui/events",
191     "//ui/gfx",
192     "//ui/gfx/geometry",
193     "//ui/gl",
194     "//ui/gl:test_support",
195     "//ui/resources",
196     "//ui/resources:ui_test_pak",
197     "//url",
198   ]
200   if (enable_notifications && !is_android) {
201     sources += [
202       "cocoa/notification_controller_unittest.mm",
203       "cocoa/popup_collection_unittest.mm",
204       "cocoa/popup_controller_unittest.mm",
205       "message_center_impl_unittest.cc",
206       "message_center_tray_unittest.cc",
207       "notification_delegate_unittest.cc",
208       "notification_list_unittest.cc",
209     ]
211     if (is_mac) {
212       deps += [ "//ui/gfx:test_support" ]
213     }
215     if (toolkit_views && !is_mac) {
216       sources += [
217         "views/bounded_label_unittest.cc",
218         "views/message_center_view_unittest.cc",
219         "views/message_popup_collection_unittest.cc",
220         "views/notification_view_unittest.cc",
221         "views/notifier_settings_view_unittest.cc",
222       ]
223       deps += [
224         # Compositor is needed by message_center_view_unittest.cc and for the
225         # fonts used by bounded_label_unittest.cc.
226         "//ui/compositor",
227         "//ui/views",
228         "//ui/views:test_support",
229       ]
230     }
231   }  # enable_notifications && !is_android