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