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") {
13 "//base/third_party/dynamic_annotations",
14 "//components/url_formatter",
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",
34 defines = [ "MESSAGE_CENTER_IMPLEMENTATION" ]
36 if (enable_notifications && !is_android) {
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",
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",
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",
75 deps += [ "//ui/aura" ]
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) {
82 "views/bounded_label.cc",
83 "views/bounded_label.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",
124 "views/message_bubble_base.cc",
125 "views/message_bubble_base.h",
126 "views/message_center_bubble.cc",
127 "views/message_center_bubble.h",
131 # Notification service disabled.
133 "dummy_message_center.cc",
134 "notification_delegate.cc",
135 "notification_delegate.h",
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.
145 "notifier_settings.cc",
146 "notifier_settings.h",
152 static_library("test_support") {
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",
169 "//base/test:test_support",
176 test("message_center_unittests") {
178 "test/run_all_unittests.cc",
186 "//base/test:test_support",
194 "//ui/gl:test_support",
196 "//ui/resources:ui_test_pak",
200 if (enable_notifications && !is_android) {
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",
212 deps += [ "//ui/gfx:test_support" ]
215 if (toolkit_views && !is_mac) {
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",
224 # Compositor is needed by message_center_view_unittest.cc and for the
225 # fonts used by bounded_label_unittest.cc.
228 "//ui/views:test_support",
231 } # enable_notifications && !is_android