| 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/common/system/web_notification/web_notification_tray.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| 11 #include "ash/common/shell_window_ids.h" | 11 #include "ash/common/shell_window_ids.h" |
| 12 #include "ash/common/system/tray/system_tray_item.h" | 12 #include "ash/common/system/tray/system_tray_item.h" |
| 13 #include "ash/common/system/web_notification/ash_popup_alignment_delegate.h" |
| 13 #include "ash/common/wm/window_state.h" | 14 #include "ash/common/wm/window_state.h" |
| 14 #include "ash/common/wm_lookup.h" | 15 #include "ash/common/wm_lookup.h" |
| 15 #include "ash/common/wm_root_window_controller.h" | 16 #include "ash/common/wm_root_window_controller.h" |
| 16 #include "ash/common/wm_shell.h" | 17 #include "ash/common/wm_shell.h" |
| 17 #include "ash/common/wm_window.h" | 18 #include "ash/common/wm_window.h" |
| 18 #include "ash/display/display_manager.h" | 19 #include "ash/display/display_manager.h" |
| 19 #include "ash/shell.h" | 20 #include "ash/shell.h" |
| 20 #include "ash/system/status_area_widget.h" | 21 #include "ash/system/status_area_widget.h" |
| 21 #include "ash/system/tray/system_tray.h" | 22 #include "ash/system/tray/system_tray.h" |
| 22 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" | |
| 23 #include "ash/test/ash_test_base.h" | 23 #include "ash/test/ash_test_base.h" |
| 24 #include "ash/test/status_area_widget_test_helper.h" | 24 #include "ash/test/status_area_widget_test_helper.h" |
| 25 #include "ash/test/test_system_tray_delegate.h" | 25 #include "ash/test/test_system_tray_delegate.h" |
| 26 #include "base/strings/stringprintf.h" | 26 #include "base/strings/stringprintf.h" |
| 27 #include "base/strings/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
| 28 #include "ui/display/display.h" | 28 #include "ui/display/display.h" |
| 29 #include "ui/display/screen.h" | 29 #include "ui/display/screen.h" |
| 30 #include "ui/events/event.h" | 30 #include "ui/events/event.h" |
| 31 #include "ui/events/test/event_generator.h" | 31 #include "ui/events/test/event_generator.h" |
| 32 #include "ui/gfx/geometry/point.h" | 32 #include "ui/gfx/geometry/point.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 views::View* CreateNotificationView(LoginStatus status) override { | 82 views::View* CreateNotificationView(LoginStatus status) override { |
| 83 return new views::View; | 83 return new views::View; |
| 84 } | 84 } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 DISALLOW_COPY_AND_ASSIGN(TestItem); | 87 DISALLOW_COPY_AND_ASSIGN(TestItem); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace | 90 } // namespace |
| 91 | 91 |
| 92 // TODO(jamescook): Move this to //ash/common. http://crbug.com/620955 |
| 92 class WebNotificationTrayTest : public test::AshTestBase { | 93 class WebNotificationTrayTest : public test::AshTestBase { |
| 93 public: | 94 public: |
| 94 WebNotificationTrayTest() {} | 95 WebNotificationTrayTest() {} |
| 95 ~WebNotificationTrayTest() override {} | 96 ~WebNotificationTrayTest() override {} |
| 96 | 97 |
| 97 void TearDown() override { | 98 void TearDown() override { |
| 98 GetMessageCenter()->RemoveAllNotifications( | 99 GetMessageCenter()->RemoveAllNotifications( |
| 99 false /* by_user */, message_center::MessageCenter::RemoveType::ALL); | 100 false /* by_user */, message_center::MessageCenter::RemoveType::ALL); |
| 100 test::AshTestBase::TearDown(); | 101 test::AshTestBase::TearDown(); |
| 101 } | 102 } |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id, | 533 ui::ET_TOUCH_RELEASED, out_of_bounds, touch_id, |
| 533 move.time_stamp() + base::TimeDelta::FromMilliseconds(50)); | 534 move.time_stamp() + base::TimeDelta::FromMilliseconds(50)); |
| 534 generator.Dispatch(&release); | 535 generator.Dispatch(&release); |
| 535 EXPECT_FALSE(tray->draw_background_as_active()); | 536 EXPECT_FALSE(tray->draw_background_as_active()); |
| 536 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); | 537 EXPECT_FALSE(tray->IsMessageCenterBubbleVisible()); |
| 537 } | 538 } |
| 538 | 539 |
| 539 #endif // OS_CHROMEOS | 540 #endif // OS_CHROMEOS |
| 540 | 541 |
| 541 } // namespace ash | 542 } // namespace ash |
| OLD | NEW |