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