Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / message_center / BUILD.gn
blobbca57932c663281252bf34a843485a8e49cf69a1
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       "message_center_switches.h",
58       "message_center_switches.cc",
59       "notification.cc",
60       "notification.h",
61       "notification_blocker.cc",
62       "notification_blocker.h",
63       "notification_list.cc",
64       "notification_list.h",
65       "notification_types.cc",
66       "notification_types.h",
67       "notifier_settings.cc",
68       "notifier_settings.h",
69     ]
71     if (is_win) {
72       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
73       cflags = [ "/wd4267" ]
74       deps += [ "//ui/aura" ]
75     }
77     if (toolkit_views) {
78       sources += [
79         "views/bounded_label.cc",
80         "views/bounded_label.h",
81         "views/constants.h",
82         "views/desktop_popup_alignment_delegate.cc",
83         "views/desktop_popup_alignment_delegate.h",
84         "views/message_center_controller.h",
85         "views/message_center_button_bar.cc",
86         "views/message_center_button_bar.h",
87         "views/message_center_view.cc",
88         "views/message_center_view.h",
89         "views/message_popup_collection.cc",
90         "views/message_popup_collection.h",
91         "views/message_view.cc",
92         "views/message_view.h",
93         "views/message_view_context_menu_controller.cc",
94         "views/message_view_context_menu_controller.h",
95         "views/notifier_settings_view.cc",
96         "views/notifier_settings_view.h",
97         "views/notification_button.cc",
98         "views/notification_button.h",
99         "views/notification_view.cc",
100         "views/notification_view.h",
101         "views/padded_button.cc",
102         "views/padded_button.h",
103         "views/popup_alignment_delegate.cc",
104         "views/popup_alignment_delegate.h",
105         "views/proportional_image_view.cc",
106         "views/proportional_image_view.h",
107         "views/toast_contents_view.cc",
108         "views/toast_contents_view.h",
109       ]
110       deps += [
111         "//ui/events",
112         "//ui/views",
113         "//ui/compositor",
114       ]
115     }
117     if (use_ash) {
118       sources += [
119         "views/message_bubble_base.cc",
120         "views/message_bubble_base.h",
121         "views/message_center_bubble.cc",
122         "views/message_center_bubble.h",
123       ]
124     }
126   } else {
127     # Notification service disabled.
128     sources = [
129       "dummy_message_center.cc",
130       "notification_delegate.cc",
131       "notification_delegate.h",
132     ]
133     # Android implements its own notification UI manager instead of deferring to
134     # the message center (when notifications are enabled). Include a minimal
135     # set of files required for notifications on Android.
136     if (is_android) {
137       sources += [
138         "notification.cc",
139         "notification.h",
140         "notifier_settings.cc",
141         "notifier_settings.h",
142       ]
143     }
144   }
147 static_library("test_support") {
148   sources = [
149     "fake_message_center.h",
150     "fake_message_center.cc",
151     "fake_message_center_tray_delegate.h",
152     "fake_message_center_tray_delegate.cc",
153     "fake_notifier_settings_provider.h",
154     "fake_notifier_settings_provider.cc",
155   ]
157   deps = [
158     ":message_center",
159     "//base",
160     "//base/test:test_support",
161     "//skia",
162     "//ui/gfx",
163     "//ui/gfx/geometry",
164   ]
167 test("message_center_unittests") {
168   sources = [
169     "test/run_all_unittests.cc",
170   ]
172   deps = [
173     ":message_center",
174     ":test_support",
175     "//base",
176     "//base/allocator",
177     "//base/test:test_support",
178     "//skia",
179     "//testing/gtest",
180     "//ui/base",
181     "//ui/gfx",
182     "//ui/gfx/geometry",
183     "//ui/resources",
184     "//ui/resources:ui_test_pak",
185     "//url",
186   ]
188   if (enable_notifications) {
189     sources += [
190       "cocoa/notification_controller_unittest.mm",
191       "cocoa/popup_collection_unittest.mm",
192       "cocoa/popup_controller_unittest.mm",
193       "cocoa/settings_controller_unittest.mm",
194       "cocoa/status_item_view_unittest.mm",
195       "cocoa/tray_controller_unittest.mm",
196       "cocoa/tray_view_controller_unittest.mm",
197       "message_center_tray_unittest.cc",
198       "message_center_impl_unittest.cc",
199       "notification_delegate_unittest.cc",
200       "notification_list_unittest.cc",
201     ]
203     if (is_mac) {
204       deps += [ "//ui/gfx:test_support" ]
205     }
207     if (toolkit_views) {
208       sources += [
209         "views/bounded_label_unittest.cc",
210         "views/message_center_view_unittest.cc",
211         "views/message_popup_collection_unittest.cc",
212         "views/notification_view_unittest.cc",
213         "views/notifier_settings_view_unittest.cc",
214       ]
215       deps += [
216         # Compositor is needed by message_center_view_unittest.cc and for the
217         # fonts used by bounded_label_unittest.cc.
218         "//ui/compositor",
219         "//ui/views",
220         "//ui/views:test_support",
221       ]
222     }
223   }  # enable_notifications