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/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
11 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
12 #include "ash/shelf/shelf_widget.h" | 12 #include "ash/shelf/shelf_widget.h" |
13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
14 #include "ash/system/status_area_widget.h" | 14 #include "ash/system/status_area_widget.h" |
15 #include "ash/system/tray/system_tray.h" | 15 #include "ash/system/tray/system_tray.h" |
16 #include "ash/system/tray/system_tray_item.h" | 16 #include "ash/system/tray/system_tray_item.h" |
17 #include "ash/test/ash_test_base.h" | 17 #include "ash/test/ash_test_base.h" |
18 #include "ash/test/test_system_tray_delegate.h" | 18 #include "ash/test/test_system_tray_delegate.h" |
19 #include "ash/wm/window_properties.h" | 19 #include "ash/wm/window_state.h" |
20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "ui/aura/client/aura_constants.h" | 22 #include "ui/aura/client/aura_constants.h" |
23 #include "ui/aura/test/event_generator.h" | 23 #include "ui/aura/test/event_generator.h" |
24 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
25 #include "ui/gfx/display.h" | 25 #include "ui/gfx/display.h" |
26 #include "ui/gfx/screen.h" | 26 #include "ui/gfx/screen.h" |
27 #include "ui/message_center/message_center_style.h" | 27 #include "ui/message_center/message_center_style.h" |
28 #include "ui/message_center/message_center_tray.h" | 28 #include "ui/message_center/message_center_tray.h" |
29 #include "ui/message_center/message_center_util.h" | 29 #include "ui/message_center/message_center_util.h" |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 // Checks the work area for normal auto-hidden state. | 422 // Checks the work area for normal auto-hidden state. |
423 scoped_ptr<aura::Window> window( | 423 scoped_ptr<aura::Window> window( |
424 CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 3, 4))); | 424 CreateTestWindowInShellWithBounds(gfx::Rect(1, 2, 3, 4))); |
425 internal::ShelfLayoutManager* shelf = | 425 internal::ShelfLayoutManager* shelf = |
426 Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); | 426 Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); |
427 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 427 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
428 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 428 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
429 gfx::Rect work_area_auto_hidden = GetPopupWorkArea(); | 429 gfx::Rect work_area_auto_hidden = GetPopupWorkArea(); |
430 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | 430 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); |
431 | 431 |
432 // Make the window to use immersive mode. | 432 // Make the window use browser immersive fullscreen. |
433 window->SetProperty(internal::kFullscreenUsesMinimalChromeKey, true); | |
434 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); | 433 window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
| 434 wm::GetWindowState(window.get())->SetFullscreenType( |
| 435 wm::FULLSCREEN_TYPE_IMMERSIVE_MINIMAL_CHROME); |
435 RunAllPendingInMessageLoop(); | 436 RunAllPendingInMessageLoop(); |
436 | 437 |
437 // The work area for auto-hidden status of fullscreen is a bit larger | 438 // The work area for auto-hidden status of fullscreen is a bit larger |
438 // since it doesn't even have the 3-pixel width. | 439 // since it doesn't even have the 3-pixel width. |
439 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 440 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
440 gfx::Rect work_area_fullscreen_hidden = GetPopupWorkArea(); | 441 gfx::Rect work_area_fullscreen_hidden = GetPopupWorkArea(); |
441 EXPECT_EQ(work_area_auto_hidden.ToString(), | 442 EXPECT_EQ(work_area_auto_hidden.ToString(), |
442 work_area_fullscreen_hidden.ToString()); | 443 work_area_fullscreen_hidden.ToString()); |
443 | 444 |
444 // Move the mouse cursor at the bottom, which shows the shelf. | 445 // Move the mouse cursor at the bottom, which shows the shelf. |
(...skipping 21 matching lines...) Expand all Loading... |
466 | 467 |
467 // System tray is created on the primary display. The popups in the secondary | 468 // System tray is created on the primary display. The popups in the secondary |
468 // tray aren't affected. | 469 // tray aren't affected. |
469 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); | 470 GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); |
470 EXPECT_GT(work_area.size().GetArea(), GetPopupWorkArea().size().GetArea()); | 471 EXPECT_GT(work_area.size().GetArea(), GetPopupWorkArea().size().GetArea()); |
471 EXPECT_EQ(work_area_second.ToString(), | 472 EXPECT_EQ(work_area_second.ToString(), |
472 GetPopupWorkAreaForTray(GetSecondaryTray()).ToString()); | 473 GetPopupWorkAreaForTray(GetSecondaryTray()).ToString()); |
473 } | 474 } |
474 | 475 |
475 } // namespace ash | 476 } // namespace ash |
OLD | NEW |