| 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/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
| 10 #include "ash/system/tray/system_tray_item.h" | 11 #include "ash/system/tray/system_tray_item.h" |
| 11 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
| 12 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 13 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 14 #include "ui/views/controls/label.h" | 15 #include "ui/views/controls/label.h" |
| 15 #include "ui/views/layout/fill_layout.h" | 16 #include "ui/views/layout/fill_layout.h" |
| 16 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
| 17 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
| 18 | 19 |
| 19 namespace ash { | 20 namespace ash { |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| 23 WebNotificationTray* GetWebNotificationTray() { | 24 WebNotificationTray* GetWebNotificationTray() { |
| 24 return Shell::GetInstance()->status_area_widget()->web_notification_tray(); | 25 return Shell::GetPrimaryRootWindowController()->status_area_widget()-> |
| 26 web_notification_tray(); |
| 25 } | 27 } |
| 26 | 28 |
| 27 class TestDelegate : public WebNotificationTray::Delegate { | 29 class TestDelegate : public WebNotificationTray::Delegate { |
| 28 public: | 30 public: |
| 29 TestDelegate() {} | 31 TestDelegate() {} |
| 30 virtual ~TestDelegate() {} | 32 virtual ~TestDelegate() {} |
| 31 | 33 |
| 32 // WebNotificationTray::Delegate overrides. | 34 // WebNotificationTray::Delegate overrides. |
| 33 virtual void NotificationRemoved(const std::string& notifcation_id) { | 35 virtual void NotificationRemoved(const std::string& notifcation_id) { |
| 34 notification_ids_.erase(notifcation_id); | 36 notification_ids_.erase(notifcation_id); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // Hide and reshow the bubble so that it is updated immediately, not delayed. | 183 // Hide and reshow the bubble so that it is updated immediately, not delayed. |
| 182 tray->HidePopupBubble(); | 184 tray->HidePopupBubble(); |
| 183 tray->ShowPopupBubble(); | 185 tray->ShowPopupBubble(); |
| 184 EXPECT_TRUE(tray->popup_bubble() != NULL); | 186 EXPECT_TRUE(tray->popup_bubble() != NULL); |
| 185 EXPECT_EQ(notifications_to_add, tray->GetNotificationCountForTest()); | 187 EXPECT_EQ(notifications_to_add, tray->GetNotificationCountForTest()); |
| 186 EXPECT_EQ(WebNotificationTray::kMaxVisiblePopupNotifications, | 188 EXPECT_EQ(WebNotificationTray::kMaxVisiblePopupNotifications, |
| 187 tray->GetPopupNotificationCountForTest()); | 189 tray->GetPopupNotificationCountForTest()); |
| 188 } | 190 } |
| 189 | 191 |
| 190 } // namespace ash | 192 } // namespace ash |
| OLD | NEW |