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")
8 component("message_center") {
12 "//base/third_party/dynamic_annotations",
25 defines = [ "MESSAGE_CENTER_IMPLEMENTATION" ]
27 if (enable_notifications) {
29 "cocoa/notification_controller.h",
30 "cocoa/notification_controller.mm",
31 "cocoa/opaque_views.h",
32 "cocoa/opaque_views.mm",
33 "cocoa/popup_collection.h",
34 "cocoa/popup_collection.mm",
35 "cocoa/popup_controller.h",
36 "cocoa/popup_controller.mm",
37 "cocoa/settings_controller.h",
38 "cocoa/settings_controller.mm",
39 "cocoa/settings_entry_view.h",
40 "cocoa/settings_entry_view.mm",
41 "cocoa/status_item_view.h",
42 "cocoa/status_item_view.mm",
43 "cocoa/tray_controller.h",
44 "cocoa/tray_controller.mm",
45 "cocoa/tray_view_controller.h",
46 "cocoa/tray_view_controller.mm",
49 "message_center_export.h",
50 "notification_delegate.cc",
51 "notification_delegate.h",
52 "message_center_impl.cc",
53 "message_center_impl.h",
54 "message_center_observer.h",
55 "message_center_style.cc",
56 "message_center_style.h",
57 "message_center_tray.cc",
58 "message_center_tray.h",
59 "message_center_tray_delegate.h",
60 "message_center_types.h",
61 "message_center_switches.h",
62 "message_center_switches.cc",
65 "notification_blocker.cc",
66 "notification_blocker.h",
67 "notification_list.cc",
68 "notification_list.h",
69 "notification_types.cc",
70 "notification_types.h",
71 "notifier_settings.cc",
72 "notifier_settings.h",
76 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
77 cflags = [ "/wd4267" ]
78 deps += [ "//ui/aura" ]
81 # On Mac, toolkit-views builds still use the Cocoa UI. Keep this in sync
82 # with message_center_unittests below.
83 if (toolkit_views && !is_mac) {
85 "views/bounded_label.cc",
86 "views/bounded_label.h",
88 "views/desktop_popup_alignment_delegate.cc",
89 "views/desktop_popup_alignment_delegate.h",
90 "views/message_center_controller.h",
91 "views/message_center_button_bar.cc",
92 "views/message_center_button_bar.h",
93 "views/message_center_view.cc",
94 "views/message_center_view.h",
95 "views/message_popup_collection.cc",
96 "views/message_popup_collection.h",
97 "views/message_view.cc",
98 "views/message_view.h",
99 "views/message_view_context_menu_controller.cc",
100 "views/message_view_context_menu_controller.h",
101 "views/notifier_settings_view.cc",
102 "views/notifier_settings_view.h",
103 "views/notification_button.cc",
104 "views/notification_button.h",
105 "views/notification_view.cc",
106 "views/notification_view.h",
107 "views/padded_button.cc",
108 "views/padded_button.h",
109 "views/popup_alignment_delegate.cc",
110 "views/popup_alignment_delegate.h",
111 "views/proportional_image_view.cc",
112 "views/proportional_image_view.h",
113 "views/toast_contents_view.cc",
114 "views/toast_contents_view.h",
125 "views/message_bubble_base.cc",
126 "views/message_bubble_base.h",
127 "views/message_center_bubble.cc",
128 "views/message_center_bubble.h",
133 # Notification service disabled.
135 "dummy_message_center.cc",
136 "notification_delegate.cc",
137 "notification_delegate.h",
139 # Android implements its own notification UI manager instead of deferring to
140 # the message center (when notifications are enabled). Include a minimal
141 # set of files required for notifications on Android.
146 "notifier_settings.cc",
147 "notifier_settings.h",
153 static_library("test_support") {
156 "fake_message_center.h",
157 "fake_message_center.cc",
158 "fake_message_center_tray_delegate.h",
159 "fake_message_center_tray_delegate.cc",
160 "fake_notifier_settings_provider.h",
161 "fake_notifier_settings_provider.cc",
170 "//base/test:test_support",
177 test("message_center_unittests") {
179 "test/run_all_unittests.cc",
187 "//base/test:test_support",
196 "//ui/resources:ui_test_pak",
200 if (enable_notifications) {
202 "cocoa/notification_controller_unittest.mm",
203 "cocoa/popup_collection_unittest.mm",
204 "cocoa/popup_controller_unittest.mm",
205 "cocoa/settings_controller_unittest.mm",
206 "cocoa/status_item_view_unittest.mm",
207 "cocoa/tray_controller_unittest.mm",
208 "cocoa/tray_view_controller_unittest.mm",
209 "message_center_tray_unittest.cc",
210 "message_center_impl_unittest.cc",
211 "notification_delegate_unittest.cc",
212 "notification_list_unittest.cc",
216 deps += [ "//ui/gfx:test_support" ]
219 if (toolkit_views && !is_mac) {
221 "views/bounded_label_unittest.cc",
222 "views/message_center_view_unittest.cc",
223 "views/message_popup_collection_unittest.cc",
224 "views/notification_view_unittest.cc",
225 "views/notifier_settings_view_unittest.cc",
228 # Compositor is needed by message_center_view_unittest.cc and for the
229 # fonts used by bounded_label_unittest.cc.
232 "//ui/views:test_support",
235 } # enable_notifications