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