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_bubble.h" | 16 #include "ui/message_center/message_center_bubble.h" |
16 #include "ui/message_center/message_center_tray.h" | 17 #include "ui/message_center/message_center_tray.h" |
17 #include "ui/message_center/message_popup_bubble.h" | 18 #include "ui/message_center/message_popup_bubble.h" |
18 #include "ui/message_center/notification_list.h" | 19 #include "ui/message_center/notification_list.h" |
19 #include "ui/message_center/notification_types.h" | 20 #include "ui/message_center/notification_types.h" |
20 #include "ui/views/controls/label.h" | 21 #include "ui/views/controls/label.h" |
21 #include "ui/views/layout/fill_layout.h" | 22 #include "ui/views/layout/fill_layout.h" |
22 #include "ui/views/view.h" | 23 #include "ui/views/view.h" |
23 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
24 | 25 |
25 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
26 #include "base/win/windows_version.h" | 27 #include "base/win/windows_version.h" |
27 #endif | 28 #endif |
28 | 29 |
29 namespace ash { | 30 namespace ash { |
30 | 31 |
31 namespace { | 32 namespace { |
32 | 33 |
33 WebNotificationTray* GetWebNotificationTray() { | 34 WebNotificationTray* GetWebNotificationTray() { |
34 return Shell::GetPrimaryRootWindowController()->status_area_widget()-> | 35 return Shell::GetPrimaryRootWindowController()->shelf()-> |
35 web_notification_tray(); | 36 status_area_widget()->web_notification_tray(); |
36 } | 37 } |
37 | 38 |
38 message_center::MessageCenter* get_message_center() { | 39 message_center::MessageCenter* get_message_center() { |
39 return GetWebNotificationTray()->message_center(); | 40 return GetWebNotificationTray()->message_center(); |
40 } | 41 } |
41 | 42 |
42 class TestDelegate : public message_center::MessageCenter::Delegate { | 43 class TestDelegate : public message_center::MessageCenter::Delegate { |
43 public: | 44 public: |
44 TestDelegate(message_center::MessageCenter* message_center) | 45 TestDelegate(message_center::MessageCenter* message_center) |
45 : message_center_(message_center) { | 46 : message_center_(message_center) { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 EXPECT_TRUE(tray->IsPopupVisible()); | 220 EXPECT_TRUE(tray->IsPopupVisible()); |
220 EXPECT_EQ(notifications_to_add, | 221 EXPECT_EQ(notifications_to_add, |
221 get_message_center()->NotificationCount()); | 222 get_message_center()->NotificationCount()); |
222 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications, | 223 EXPECT_EQ(NotificationList::kMaxVisiblePopupNotifications, |
223 tray->GetPopupBubbleForTest()->NumMessageViewsForTest()); | 224 tray->GetPopupBubbleForTest()->NumMessageViewsForTest()); |
224 get_message_center()->SetDelegate(NULL); | 225 get_message_center()->SetDelegate(NULL); |
225 get_message_center()->notification_list()->RemoveAllNotifications(); | 226 get_message_center()->notification_list()->RemoveAllNotifications(); |
226 } | 227 } |
227 | 228 |
228 } // namespace ash | 229 } // namespace ash |
OLD | NEW |