| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/web_notification/web_notification_tray.h" | 5 #include "ash/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shelf/shelf_widget.h" |
| 10 #include "ash/system/status_area_widget.h" | 11 #include "ash/system/status_area_widget.h" |
| 11 #include "ash/system/tray/system_tray_item.h" | 12 #include "ash/system/tray/system_tray_item.h" |
| 12 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
| 13 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 15 #include "ui/message_center/message_center_tray.h" | 16 #include "ui/message_center/message_center_tray.h" |
| 16 #include "ui/message_center/message_center_util.h" | 17 #include "ui/message_center/message_center_util.h" |
| 17 #include "ui/message_center/notification_list.h" | 18 #include "ui/message_center/notification_list.h" |
| 18 #include "ui/message_center/notification_types.h" | 19 #include "ui/message_center/notification_types.h" |
| 19 #include "ui/message_center/views/message_center_bubble.h" | 20 #include "ui/message_center/views/message_center_bubble.h" |
| 20 #include "ui/message_center/views/message_popup_bubble.h" | 21 #include "ui/message_center/views/message_popup_bubble.h" |
| 21 #include "ui/message_center/views/message_popup_collection.h" | 22 #include "ui/message_center/views/message_popup_collection.h" |
| 22 #include "ui/views/controls/label.h" | 23 #include "ui/views/controls/label.h" |
| 23 #include "ui/views/layout/fill_layout.h" | 24 #include "ui/views/layout/fill_layout.h" |
| 24 #include "ui/views/view.h" | 25 #include "ui/views/view.h" |
| 25 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| 26 | 27 |
| 27 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 28 #include "base/win/windows_version.h" | 29 #include "base/win/windows_version.h" |
| 29 #endif | 30 #endif |
| 30 | 31 |
| 31 namespace ash { | 32 namespace ash { |
| 32 | 33 |
| 33 namespace { | 34 namespace { |
| 34 | 35 |
| 35 WebNotificationTray* GetWebNotificationTray() { | 36 WebNotificationTray* GetWebNotificationTray() { |
| 36 return Shell::GetPrimaryRootWindowController()->status_area_widget()-> | 37 return Shell::GetPrimaryRootWindowController()->shelf()-> |
| 37 web_notification_tray(); | 38 status_area_widget()->web_notification_tray(); |
| 38 } | 39 } |
| 39 | 40 |
| 40 message_center::MessageCenter* get_message_center() { | 41 message_center::MessageCenter* get_message_center() { |
| 41 return GetWebNotificationTray()->message_center(); | 42 return GetWebNotificationTray()->message_center(); |
| 42 } | 43 } |
| 43 | 44 |
| 44 class TestDelegate : public message_center::MessageCenter::Delegate { | 45 class TestDelegate : public message_center::MessageCenter::Delegate { |
| 45 public: | 46 public: |
| 46 TestDelegate(message_center::MessageCenter* message_center) | 47 TestDelegate(message_center::MessageCenter* message_center) |
| 47 : message_center_(message_center) { | 48 : message_center_(message_center) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications, popups.size()); | 230 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications, popups.size()); |
| 230 } else { | 231 } else { |
| 231 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications, | 232 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications, |
| 232 tray->GetPopupBubbleForTest()->NumMessageViewsForTest()); | 233 tray->GetPopupBubbleForTest()->NumMessageViewsForTest()); |
| 233 } | 234 } |
| 234 get_message_center()->SetDelegate(NULL); | 235 get_message_center()->SetDelegate(NULL); |
| 235 get_message_center()->notification_list()->RemoveAllNotifications(); | 236 get_message_center()->notification_list()->RemoveAllNotifications(); |
| 236 } | 237 } |
| 237 | 238 |
| 238 } // namespace ash | 239 } // namespace ash |
| OLD | NEW |