| 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 <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/public/cpp/config.h" | 10 #include "ash/public/cpp/config.h" |
| 11 #include "ash/public/cpp/shell_window_ids.h" | 11 #include "ash/public/cpp/shell_window_ids.h" |
| 12 #include "ash/shelf/shelf_layout_manager.h" | 12 #include "ash/shelf/shelf_layout_manager.h" |
| 13 #include "ash/shelf/wm_shelf.h" | 13 #include "ash/shelf/wm_shelf.h" |
| 14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 15 #include "ash/system/screen_layout_observer.h" | 15 #include "ash/system/screen_layout_observer.h" |
| 16 #include "ash/system/status_area_widget.h" | 16 #include "ash/system/status_area_widget.h" |
| 17 #include "ash/system/tray/system_tray.h" | 17 #include "ash/system/tray/system_tray.h" |
| 18 #include "ash/system/tray/system_tray_item.h" | 18 #include "ash/system/tray/system_tray_item.h" |
| 19 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" | 19 #include "ash/system/web_notification/ash_popup_alignment_delegate.h" |
| 20 #include "ash/test/ash_test_base.h" | 20 #include "ash/test/ash_test_base.h" |
| 21 #include "ash/test/status_area_widget_test_helper.h" | 21 #include "ash/test/status_area_widget_test_helper.h" |
| 22 #include "ash/test/test_system_tray_delegate.h" | 22 #include "ash/test/test_system_tray_delegate.h" |
| 23 #include "ash/wm/window_state.h" | 23 #include "ash/wm/window_state.h" |
| 24 #include "ash/wm_window.h" | 24 #include "ash/wm/window_state_aura.h" |
| 25 #include "base/memory/ptr_util.h" | 25 #include "base/memory/ptr_util.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/manager/display_manager.h" | 29 #include "ui/display/manager/display_manager.h" |
| 30 #include "ui/display/screen.h" | 30 #include "ui/display/screen.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" |
| 33 #include "ui/gfx/geometry/rect.h" | 33 #include "ui/gfx/geometry/rect.h" |
| 34 #include "ui/message_center/message_center_style.h" | 34 #include "ui/message_center/message_center_style.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 std::unique_ptr<views::Widget> widget(CreateTestWidget()); | 345 std::unique_ptr<views::Widget> widget(CreateTestWidget()); |
| 346 WmShelf* shelf = GetPrimaryShelf(); | 346 WmShelf* shelf = GetPrimaryShelf(); |
| 347 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 347 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 348 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); | 348 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); |
| 349 int bottom_auto_hidden = GetPopupWorkAreaBottom(); | 349 int bottom_auto_hidden = GetPopupWorkAreaBottom(); |
| 350 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 350 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
| 351 | 351 |
| 352 // Put |widget| into fullscreen without forcing the shelf to hide. Currently, | 352 // Put |widget| into fullscreen without forcing the shelf to hide. Currently, |
| 353 // this is used by immersive fullscreen and forces the shelf to be auto | 353 // this is used by immersive fullscreen and forces the shelf to be auto |
| 354 // hidden. | 354 // hidden. |
| 355 WmWindow::Get(widget->GetNativeWindow()) | 355 wm::GetWindowState(widget->GetNativeWindow()) |
| 356 ->GetWindowState() | |
| 357 ->set_hide_shelf_when_fullscreen(false); | 356 ->set_hide_shelf_when_fullscreen(false); |
| 358 widget->SetFullscreen(true); | 357 widget->SetFullscreen(true); |
| 359 RunAllPendingInMessageLoop(); | 358 RunAllPendingInMessageLoop(); |
| 360 | 359 |
| 361 // The work area for auto-hidden status of fullscreen is a bit larger | 360 // The work area for auto-hidden status of fullscreen is a bit larger |
| 362 // since it doesn't even have the 3-pixel width. | 361 // since it doesn't even have the 3-pixel width. |
| 363 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); | 362 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); |
| 364 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom(); | 363 int bottom_fullscreen_hidden = GetPopupWorkAreaBottom(); |
| 365 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden); | 364 EXPECT_EQ(bottom_auto_hidden, bottom_fullscreen_hidden); |
| 366 | 365 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 389 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray()); | 388 int bottom_second = GetPopupWorkAreaBottomForTray(GetSecondaryTray()); |
| 390 | 389 |
| 391 // System tray is created on the primary display. The popups in the secondary | 390 // System tray is created on the primary display. The popups in the secondary |
| 392 // tray aren't affected. | 391 // tray aren't affected. |
| 393 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); | 392 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); |
| 394 EXPECT_GT(bottom, GetPopupWorkAreaBottom()); | 393 EXPECT_GT(bottom, GetPopupWorkAreaBottom()); |
| 395 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray())); | 394 EXPECT_EQ(bottom_second, GetPopupWorkAreaBottomForTray(GetSecondaryTray())); |
| 396 } | 395 } |
| 397 | 396 |
| 398 } // namespace ash | 397 } // namespace ash |
| OLD | NEW |