[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 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. |
| 4 | |
| 5 | import("//build/config/features.gni") |
| 6 | import("//build/config/ui.gni") |
qsr | fb5251d1 | 2015-01-21 15:57:22 | [diff] [blame] | 7 | import("//testing/test.gni") |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 8 | |
| 9 | component("message_center") { |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 10 | deps = [ |
| 11 | "//base", |
| 12 | "//base:i18n", |
| 13 | "//base/third_party/dynamic_annotations", |
| 14 | "//skia", |
Brett Wilson | 5e4c24b9 | 2014-08-28 19:34:11 | [diff] [blame] | 15 | "//ui/accessibility", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 16 | "//ui/base", |
Brett Wilson | 5e4c24b9 | 2014-08-28 19:34:11 | [diff] [blame] | 17 | "//ui/events", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 18 | "//ui/gfx", |
| 19 | "//ui/gfx/geometry", |
Brett Wilson | 0380637c | 2014-09-19 21:24:40 | [diff] [blame] | 20 | "//ui/native_theme", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 21 | "//ui/resources", |
| 22 | "//ui/strings", |
Brett Wilson | 0380637c | 2014-09-19 21:24:40 | [diff] [blame] | 23 | "//url", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 24 | ] |
| 25 | |
brettw | d1c719a | 2015-02-19 23:17:04 | [diff] [blame^] | 26 | # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 27 | configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 28 | |
Brett Wilson | 0380637c | 2014-09-19 21:24:40 | [diff] [blame] | 29 | defines = [ "MESSAGE_CENTER_IMPLEMENTATION" ] |
| 30 | |
peter | 28dd519c | 2014-11-08 17:06:52 | [diff] [blame] | 31 | if (enable_notifications && !is_android) { |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 32 | sources = [ |
| 33 | "cocoa/notification_controller.h", |
| 34 | "cocoa/notification_controller.mm", |
| 35 | "cocoa/opaque_views.h", |
| 36 | "cocoa/opaque_views.mm", |
| 37 | "cocoa/popup_collection.h", |
| 38 | "cocoa/popup_collection.mm", |
| 39 | "cocoa/popup_controller.h", |
| 40 | "cocoa/popup_controller.mm", |
| 41 | "cocoa/settings_controller.h", |
| 42 | "cocoa/settings_controller.mm", |
| 43 | "cocoa/settings_entry_view.h", |
| 44 | "cocoa/settings_entry_view.mm", |
| 45 | "cocoa/status_item_view.h", |
| 46 | "cocoa/status_item_view.mm", |
| 47 | "cocoa/tray_controller.h", |
| 48 | "cocoa/tray_controller.mm", |
| 49 | "cocoa/tray_view_controller.h", |
| 50 | "cocoa/tray_view_controller.mm", |
| 51 | "message_center.cc", |
| 52 | "message_center.h", |
| 53 | "message_center_export.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 54 | "message_center_impl.cc", |
| 55 | "message_center_impl.h", |
| 56 | "message_center_observer.h", |
| 57 | "message_center_style.cc", |
| 58 | "message_center_style.h", |
satorux | d3ce5e2 | 2015-02-18 01:01:42 | [diff] [blame] | 59 | "message_center_switches.cc", |
| 60 | "message_center_switches.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 61 | "message_center_tray.cc", |
| 62 | "message_center_tray.h", |
| 63 | "message_center_tray_delegate.h", |
| 64 | "message_center_types.h", |
| 65 | "notification.cc", |
| 66 | "notification.h", |
| 67 | "notification_blocker.cc", |
| 68 | "notification_blocker.h", |
satorux | d3ce5e2 | 2015-02-18 01:01:42 | [diff] [blame] | 69 | "notification_delegate.cc", |
| 70 | "notification_delegate.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 71 | "notification_list.cc", |
| 72 | "notification_list.h", |
| 73 | "notification_types.cc", |
| 74 | "notification_types.h", |
| 75 | "notifier_settings.cc", |
| 76 | "notifier_settings.h", |
| 77 | ] |
| 78 | |
| 79 | if (is_win) { |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 80 | deps += [ "//ui/aura" ] |
| 81 | } |
| 82 | |
tapted | a9dbe443 | 2014-09-10 00:12:43 | [diff] [blame] | 83 | # On Mac, toolkit-views builds still use the Cocoa UI. Keep this in sync |
| 84 | # with message_center_unittests below. |
| 85 | if (toolkit_views && !is_mac) { |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 86 | sources += [ |
| 87 | "views/bounded_label.cc", |
| 88 | "views/bounded_label.h", |
| 89 | "views/constants.h", |
| 90 | "views/desktop_popup_alignment_delegate.cc", |
| 91 | "views/desktop_popup_alignment_delegate.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 92 | "views/message_center_button_bar.cc", |
| 93 | "views/message_center_button_bar.h", |
satorux | d3ce5e2 | 2015-02-18 01:01:42 | [diff] [blame] | 94 | "views/message_center_controller.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 95 | "views/message_center_view.cc", |
| 96 | "views/message_center_view.h", |
| 97 | "views/message_popup_collection.cc", |
| 98 | "views/message_popup_collection.h", |
| 99 | "views/message_view.cc", |
| 100 | "views/message_view.h", |
| 101 | "views/message_view_context_menu_controller.cc", |
| 102 | "views/message_view_context_menu_controller.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 103 | "views/notification_button.cc", |
| 104 | "views/notification_button.h", |
| 105 | "views/notification_view.cc", |
| 106 | "views/notification_view.h", |
satorux | d3ce5e2 | 2015-02-18 01:01:42 | [diff] [blame] | 107 | "views/notifier_settings_view.cc", |
| 108 | "views/notifier_settings_view.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 109 | "views/padded_button.cc", |
| 110 | "views/padded_button.h", |
| 111 | "views/popup_alignment_delegate.cc", |
| 112 | "views/popup_alignment_delegate.h", |
| 113 | "views/proportional_image_view.cc", |
| 114 | "views/proportional_image_view.h", |
| 115 | "views/toast_contents_view.cc", |
| 116 | "views/toast_contents_view.h", |
| 117 | ] |
| 118 | deps += [ |
| 119 | "//ui/events", |
| 120 | "//ui/views", |
| 121 | "//ui/compositor", |
| 122 | ] |
| 123 | } |
| 124 | |
| 125 | if (use_ash) { |
| 126 | sources += [ |
| 127 | "views/message_bubble_base.cc", |
| 128 | "views/message_bubble_base.h", |
| 129 | "views/message_center_bubble.cc", |
| 130 | "views/message_center_bubble.h", |
| 131 | ] |
| 132 | } |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 133 | } else { |
| 134 | # Notification service disabled. |
| 135 | sources = [ |
| 136 | "dummy_message_center.cc", |
| 137 | "notification_delegate.cc", |
| 138 | "notification_delegate.h", |
| 139 | ] |
scottmg | bba95ce | 2014-12-03 07:28:23 | [diff] [blame] | 140 | |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 141 | # Android implements its own notification UI manager instead of deferring to |
| 142 | # the message center (when notifications are enabled). Include a minimal |
| 143 | # set of files required for notifications on Android. |
| 144 | if (is_android) { |
| 145 | sources += [ |
| 146 | "notification.cc", |
| 147 | "notification.h", |
| 148 | "notifier_settings.cc", |
| 149 | "notifier_settings.h", |
| 150 | ] |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | static_library("test_support") { |
Brett Wilson | 8f80ad0b | 2014-09-08 19:50:24 | [diff] [blame] | 156 | testonly = true |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 157 | sources = [ |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 158 | "fake_message_center.cc", |
satorux | d3ce5e2 | 2015-02-18 01:01:42 | [diff] [blame] | 159 | "fake_message_center.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 160 | "fake_message_center_tray_delegate.cc", |
satorux | d3ce5e2 | 2015-02-18 01:01:42 | [diff] [blame] | 161 | "fake_message_center_tray_delegate.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 162 | "fake_notifier_settings_provider.cc", |
satorux | d3ce5e2 | 2015-02-18 01:01:42 | [diff] [blame] | 163 | "fake_notifier_settings_provider.h", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 164 | ] |
| 165 | |
Brett Wilson | 0380637c | 2014-09-19 21:24:40 | [diff] [blame] | 166 | public_deps = [ |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 167 | ":message_center", |
Brett Wilson | 0380637c | 2014-09-19 21:24:40 | [diff] [blame] | 168 | ] |
| 169 | |
| 170 | deps = [ |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 171 | "//base", |
| 172 | "//base/test:test_support", |
| 173 | "//skia", |
| 174 | "//ui/gfx", |
| 175 | "//ui/gfx/geometry", |
| 176 | ] |
| 177 | } |
| 178 | |
brettw | 6aa18956 | 2015-02-02 05:34:22 | [diff] [blame] | 179 | if (!is_win || link_chrome_on_windows) { |
| 180 | test("message_center_unittests") { |
| 181 | sources = [ |
| 182 | "test/run_all_unittests.cc", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 183 | ] |
| 184 | |
brettw | 6aa18956 | 2015-02-02 05:34:22 | [diff] [blame] | 185 | deps = [ |
| 186 | ":message_center", |
| 187 | ":test_support", |
| 188 | "//base", |
| 189 | "//base/allocator", |
| 190 | "//base/test:test_support", |
| 191 | "//skia", |
| 192 | "//testing/gtest", |
| 193 | "//ui/base", |
| 194 | "//ui/events", |
| 195 | "//ui/gfx", |
| 196 | "//ui/gfx/geometry", |
| 197 | "//ui/gl", |
| 198 | "//ui/resources", |
| 199 | "//ui/resources:ui_test_pak", |
| 200 | "//url", |
| 201 | ] |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 202 | |
brettw | 6aa18956 | 2015-02-02 05:34:22 | [diff] [blame] | 203 | if (enable_notifications && !is_android) { |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 204 | sources += [ |
brettw | 6aa18956 | 2015-02-02 05:34:22 | [diff] [blame] | 205 | "cocoa/notification_controller_unittest.mm", |
| 206 | "cocoa/popup_collection_unittest.mm", |
| 207 | "cocoa/popup_controller_unittest.mm", |
| 208 | "cocoa/settings_controller_unittest.mm", |
| 209 | "cocoa/status_item_view_unittest.mm", |
| 210 | "cocoa/tray_controller_unittest.mm", |
| 211 | "cocoa/tray_view_controller_unittest.mm", |
brettw | 6aa18956 | 2015-02-02 05:34:22 | [diff] [blame] | 212 | "message_center_impl_unittest.cc", |
satorux | d3ce5e2 | 2015-02-18 01:01:42 | [diff] [blame] | 213 | "message_center_tray_unittest.cc", |
brettw | 6aa18956 | 2015-02-02 05:34:22 | [diff] [blame] | 214 | "notification_delegate_unittest.cc", |
| 215 | "notification_list_unittest.cc", |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 216 | ] |
brettw | 6aa18956 | 2015-02-02 05:34:22 | [diff] [blame] | 217 | |
| 218 | if (is_mac) { |
| 219 | deps += [ "//ui/gfx:test_support" ] |
| 220 | } |
| 221 | |
| 222 | if (toolkit_views && !is_mac) { |
| 223 | sources += [ |
| 224 | "views/bounded_label_unittest.cc", |
| 225 | "views/message_center_view_unittest.cc", |
| 226 | "views/message_popup_collection_unittest.cc", |
| 227 | "views/notification_view_unittest.cc", |
| 228 | "views/notifier_settings_view_unittest.cc", |
| 229 | ] |
| 230 | deps += [ |
| 231 | # Compositor is needed by message_center_view_unittest.cc and for the |
| 232 | # fonts used by bounded_label_unittest.cc. |
| 233 | "//ui/compositor", |
| 234 | "//ui/views", |
| 235 | "//ui/views:test_support", |
| 236 | ] |
| 237 | } |
| 238 | } # enable_notifications && !is_android |
| 239 | } |
[email protected] | a1d7d4f | 2014-07-16 21:33:36 | [diff] [blame] | 240 | } |