Add display, message_center, shell_dialogs, webview to GN build.

[email protected]

Review URL: https://codereview.chromium.org/393953008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283516 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/message_center/BUILD.gn b/ui/message_center/BUILD.gn
new file mode 100644
index 0000000..24a722e8
--- /dev/null
+++ b/ui/message_center/BUILD.gn
@@ -0,0 +1,227 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/features.gni")
+import("//build/config/ui.gni")
+
+component("message_center") {
+  defines = [ "MESSAGE_CENTER_IMPLEMENTATION" ]
+
+  deps = [
+    "//base",
+    "//base:i18n",
+    "//base/third_party/dynamic_annotations",
+    "//skia",
+    "//ui/base",
+    "//ui/gfx",
+    "//ui/gfx/geometry",
+    "//ui/resources",
+    "//ui/strings",
+  ]
+
+  if (enable_notifications) {
+    sources = [
+      "cocoa/notification_controller.h",
+      "cocoa/notification_controller.mm",
+      "cocoa/opaque_views.h",
+      "cocoa/opaque_views.mm",
+      "cocoa/popup_collection.h",
+      "cocoa/popup_collection.mm",
+      "cocoa/popup_controller.h",
+      "cocoa/popup_controller.mm",
+      "cocoa/settings_controller.h",
+      "cocoa/settings_controller.mm",
+      "cocoa/settings_entry_view.h",
+      "cocoa/settings_entry_view.mm",
+      "cocoa/status_item_view.h",
+      "cocoa/status_item_view.mm",
+      "cocoa/tray_controller.h",
+      "cocoa/tray_controller.mm",
+      "cocoa/tray_view_controller.h",
+      "cocoa/tray_view_controller.mm",
+      "message_center.cc",
+      "message_center.h",
+      "message_center_export.h",
+      "notification_delegate.cc",
+      "notification_delegate.h",
+      "message_center_impl.cc",
+      "message_center_impl.h",
+      "message_center_observer.h",
+      "message_center_style.cc",
+      "message_center_style.h",
+      "message_center_tray.cc",
+      "message_center_tray.h",
+      "message_center_tray_delegate.h",
+      "message_center_types.h",
+      "notification.cc",
+      "notification.h",
+      "notification_blocker.cc",
+      "notification_blocker.h",
+      "notification_list.cc",
+      "notification_list.h",
+      "notification_types.cc",
+      "notification_types.h",
+      "notifier_settings.cc",
+      "notifier_settings.h",
+    ]
+
+    if (is_win) {
+      # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
+      cflags = [ "/wd4267" ]
+      deps += [ "//ui/aura" ]
+    }
+
+    if (toolkit_views) {
+      sources += [
+        "views/bounded_label.cc",
+        "views/bounded_label.h",
+        "views/constants.h",
+        "views/desktop_popup_alignment_delegate.cc",
+        "views/desktop_popup_alignment_delegate.h",
+        "views/message_center_controller.h",
+        "views/message_center_button_bar.cc",
+        "views/message_center_button_bar.h",
+        "views/message_center_view.cc",
+        "views/message_center_view.h",
+        "views/message_popup_collection.cc",
+        "views/message_popup_collection.h",
+        "views/message_view.cc",
+        "views/message_view.h",
+        "views/message_view_context_menu_controller.cc",
+        "views/message_view_context_menu_controller.h",
+        "views/notifier_settings_view.cc",
+        "views/notifier_settings_view.h",
+        "views/notification_button.cc",
+        "views/notification_button.h",
+        "views/notification_view.cc",
+        "views/notification_view.h",
+        "views/padded_button.cc",
+        "views/padded_button.h",
+        "views/popup_alignment_delegate.cc",
+        "views/popup_alignment_delegate.h",
+        "views/proportional_image_view.cc",
+        "views/proportional_image_view.h",
+        "views/toast_contents_view.cc",
+        "views/toast_contents_view.h",
+      ]
+      deps += [
+        "//ui/events",
+        "//ui/views",
+        "//ui/compositor",
+      ]
+    }
+
+    if (use_ash) {
+      sources += [
+        "views/message_bubble_base.cc",
+        "views/message_bubble_base.h",
+        "views/message_center_bubble.cc",
+        "views/message_center_bubble.h",
+      ]
+    }
+
+  } else {
+    # Notification service disabled.
+    sources = [
+      "dummy_message_center.cc",
+      "notification_delegate.cc",
+      "notification_delegate.h",
+    ]
+    # Android implements its own notification UI manager instead of deferring to
+    # the message center (when notifications are enabled). Include a minimal
+    # set of files required for notifications on Android.
+    if (is_android) {
+      sources += [
+        "notification.cc",
+        "notification.h",
+        "notifier_settings.cc",
+        "notifier_settings.h",
+      ]
+    }
+  }
+}
+
+static_library("test_support") {
+  sources = [
+    "fake_message_center.h",
+    "fake_message_center.cc",
+    "fake_message_center_tray_delegate.h",
+    "fake_message_center_tray_delegate.cc",
+    "fake_notifier_settings_provider.h",
+    "fake_notifier_settings_provider.cc",
+  ]
+
+  deps = [
+    ":message_center",
+    "//base",
+    "//base/test:test_support",
+    "//skia",
+    "//ui/gfx",
+    "//ui/gfx/geometry",
+  ]
+}
+
+# TODO(GYP) Enable this when media is linked.
+if (false) {
+
+test("message_center_unittests") {
+  sources = [
+    "test/run_all_unittests.cc",
+  ]
+
+  deps = [
+    ":message_center",
+    ":test_support",
+    "//base",
+    "//base/allocator",
+    "//base/test:test_support",
+    "//skia",
+    "//testing/gtest",
+    "//ui/base",
+    "//ui/gfx",
+    "//ui/gfx/geometry",
+    "//ui/resources",
+    "//ui/resources:ui_test_pak",
+    "//url",
+  ]
+
+  if (enable_notifications) {
+    sources += [
+      "cocoa/notification_controller_unittest.mm",
+      "cocoa/popup_collection_unittest.mm",
+      "cocoa/popup_controller_unittest.mm",
+      "cocoa/settings_controller_unittest.mm",
+      "cocoa/status_item_view_unittest.mm",
+      "cocoa/tray_controller_unittest.mm",
+      "cocoa/tray_view_controller_unittest.mm",
+      "message_center_tray_unittest.cc",
+      "message_center_impl_unittest.cc",
+      "notification_delegate_unittest.cc",
+      "notification_list_unittest.cc",
+    ]
+
+    if (is_mac) {
+      deps += [ "//ui/gfx:test_support" ]
+    }
+
+    if (toolkit_views) {
+      sources += [
+        "views/bounded_label_unittest.cc",
+        "views/message_center_view_unittest.cc",
+        "views/message_popup_collection_unittest.cc",
+        "views/notification_view_unittest.cc",
+        "views/notifier_settings_view_unittest.cc",
+      ]
+      deps += [
+        # Compositor is needed by message_center_view_unittest.cc and for the
+        # fonts used by bounded_label_unittest.cc.
+        "//ui/compositor",
+        "//ui/views",
+        "//ui/views:test_support",
+      ]
+    }
+  }  # enable_notifications
+}
+
+}  # if false