cc: Add more eviction categories to picture layer impl.
[chromium-blink-merge.git] / ui / message_center / BUILD.gn
blob03a6d106dce6df9a79343edad0aa3de54a2bd871
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") {
9   defines = [ "MESSAGE_CENTER_IMPLEMENTATION" ]
11   deps = [
12     "//base",
13     "//base:i18n",
14     "//base/third_party/dynamic_annotations",
15     "//skia",
16     "//ui/base",
17     "//ui/gfx",
18     "//ui/gfx/geometry",
19     "//ui/resources",
20     "//ui/strings",
21   ]
23   if (enable_notifications) {
24     sources = [
25       "cocoa/notification_controller.h",
26       "cocoa/notification_controller.mm",
27       "cocoa/opaque_views.h",
28       "cocoa/opaque_views.mm",
29       "cocoa/popup_collection.h",
30       "cocoa/popup_collection.mm",
31       "cocoa/popup_controller.h",
32       "cocoa/popup_controller.mm",
33       "cocoa/settings_controller.h",
34       "cocoa/settings_controller.mm",
35       "cocoa/settings_entry_view.h",
36       "cocoa/settings_entry_view.mm",
37       "cocoa/status_item_view.h",
38       "cocoa/status_item_view.mm",
39       "cocoa/tray_controller.h",
40       "cocoa/tray_controller.mm",
41       "cocoa/tray_view_controller.h",
42       "cocoa/tray_view_controller.mm",
43       "message_center.cc",
44       "message_center.h",
45       "message_center_export.h",
46       "notification_delegate.cc",
47       "notification_delegate.h",
48       "message_center_impl.cc",
49       "message_center_impl.h",
50       "message_center_observer.h",
51       "message_center_style.cc",
52       "message_center_style.h",
53       "message_center_tray.cc",
54       "message_center_tray.h",
55       "message_center_tray_delegate.h",
56       "message_center_types.h",
57       "notification.cc",
58       "notification.h",
59       "notification_blocker.cc",
60       "notification_blocker.h",
61       "notification_list.cc",
62       "notification_list.h",
63       "notification_types.cc",
64       "notification_types.h",
65       "notifier_settings.cc",
66       "notifier_settings.h",
67     ]
69     if (is_win) {
70       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
71       cflags = [ "/wd4267" ]
72       deps += [ "//ui/aura" ]
73     }
75     if (toolkit_views) {
76       sources += [
77         "views/bounded_label.cc",
78         "views/bounded_label.h",
79         "views/constants.h",
80         "views/desktop_popup_alignment_delegate.cc",
81         "views/desktop_popup_alignment_delegate.h",
82         "views/message_center_controller.h",
83         "views/message_center_button_bar.cc",
84         "views/message_center_button_bar.h",
85         "views/message_center_view.cc",
86         "views/message_center_view.h",
87         "views/message_popup_collection.cc",
88         "views/message_popup_collection.h",
89         "views/message_view.cc",
90         "views/message_view.h",
91         "views/message_view_context_menu_controller.cc",
92         "views/message_view_context_menu_controller.h",
93         "views/notifier_settings_view.cc",
94         "views/notifier_settings_view.h",
95         "views/notification_button.cc",
96         "views/notification_button.h",
97         "views/notification_view.cc",
98         "views/notification_view.h",
99         "views/padded_button.cc",
100         "views/padded_button.h",
101         "views/popup_alignment_delegate.cc",
102         "views/popup_alignment_delegate.h",
103         "views/proportional_image_view.cc",
104         "views/proportional_image_view.h",
105         "views/toast_contents_view.cc",
106         "views/toast_contents_view.h",
107       ]
108       deps += [
109         "//ui/events",
110         "//ui/views",
111         "//ui/compositor",
112       ]
113     }
115     if (use_ash) {
116       sources += [
117         "views/message_bubble_base.cc",
118         "views/message_bubble_base.h",
119         "views/message_center_bubble.cc",
120         "views/message_center_bubble.h",
121       ]
122     }
124   } else {
125     # Notification service disabled.
126     sources = [
127       "dummy_message_center.cc",
128       "notification_delegate.cc",
129       "notification_delegate.h",
130     ]
131     # Android implements its own notification UI manager instead of deferring to
132     # the message center (when notifications are enabled). Include a minimal
133     # set of files required for notifications on Android.
134     if (is_android) {
135       sources += [
136         "notification.cc",
137         "notification.h",
138         "notifier_settings.cc",
139         "notifier_settings.h",
140       ]
141     }
142   }
145 static_library("test_support") {
146   sources = [
147     "fake_message_center.h",
148     "fake_message_center.cc",
149     "fake_message_center_tray_delegate.h",
150     "fake_message_center_tray_delegate.cc",
151     "fake_notifier_settings_provider.h",
152     "fake_notifier_settings_provider.cc",
153   ]
155   deps = [
156     ":message_center",
157     "//base",
158     "//base/test:test_support",
159     "//skia",
160     "//ui/gfx",
161     "//ui/gfx/geometry",
162   ]
165 test("message_center_unittests") {
166   sources = [
167     "test/run_all_unittests.cc",
168   ]
170   deps = [
171     ":message_center",
172     ":test_support",
173     "//base",
174     "//base/allocator",
175     "//base/test:test_support",
176     "//skia",
177     "//testing/gtest",
178     "//ui/base",
179     "//ui/gfx",
180     "//ui/gfx/geometry",
181     "//ui/resources",
182     "//ui/resources:ui_test_pak",
183     "//url",
184   ]
186   if (enable_notifications) {
187     sources += [
188       "cocoa/notification_controller_unittest.mm",
189       "cocoa/popup_collection_unittest.mm",
190       "cocoa/popup_controller_unittest.mm",
191       "cocoa/settings_controller_unittest.mm",
192       "cocoa/status_item_view_unittest.mm",
193       "cocoa/tray_controller_unittest.mm",
194       "cocoa/tray_view_controller_unittest.mm",
195       "message_center_tray_unittest.cc",
196       "message_center_impl_unittest.cc",
197       "notification_delegate_unittest.cc",
198       "notification_list_unittest.cc",
199     ]
201     if (is_mac) {
202       deps += [ "//ui/gfx:test_support" ]
203     }
205     if (toolkit_views) {
206       sources += [
207         "views/bounded_label_unittest.cc",
208         "views/message_center_view_unittest.cc",
209         "views/message_popup_collection_unittest.cc",
210         "views/notification_view_unittest.cc",
211         "views/notifier_settings_view_unittest.cc",
212       ]
213       deps += [
214         # Compositor is needed by message_center_view_unittest.cc and for the
215         # fonts used by bounded_label_unittest.cc.
216         "//ui/compositor",
217         "//ui/views",
218         "//ui/views:test_support",
219       ]
220     }
221   }  # enable_notifications