| 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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 base::Bind(&ShelfDragCallback::ProcessScroll, | 573 base::Bind(&ShelfDragCallback::ProcessScroll, |
| 574 base::Unretained(&handler))); | 574 base::Unretained(&handler))); |
| 575 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 575 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
| 576 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 576 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
| 577 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); | 577 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); |
| 578 EXPECT_EQ(GetShelfWidget()->GetDimmerBoundsForTest(), gfx::Rect()); | 578 EXPECT_EQ(GetShelfWidget()->GetDimmerBoundsForTest(), gfx::Rect()); |
| 579 EXPECT_EQ(bounds_noshelf.ToString(), window->bounds().ToString()); | 579 EXPECT_EQ(bounds_noshelf.ToString(), window->bounds().ToString()); |
| 580 EXPECT_EQ(shelf_hidden.ToString(), | 580 EXPECT_EQ(shelf_hidden.ToString(), |
| 581 GetShelfWidget()->GetWindowBoundsInScreen().ToString()); | 581 GetShelfWidget()->GetWindowBoundsInScreen().ToString()); |
| 582 | 582 |
| 583 // Enter into fullscreen with minimal chrome (immersive fullscreen). | 583 // Enter into immersive fullscreen with minimal chrome (browser fullscreen). |
| 584 widget->SetFullscreen(true); | 584 widget->SetFullscreen(true); |
| 585 window->SetProperty(ash::internal::kFullscreenUsesMinimalChromeKey, true); | 585 window->SetProperty(ash::internal::kFullscreenTypeKey, |
| 586 ash::wm::FULLSCREEN_TYPE_IMMERSIVE_MINIMAL_CHROME); |
| 586 shelf->UpdateVisibilityState(); | 587 shelf->UpdateVisibilityState(); |
| 587 | 588 |
| 588 gfx::Rect bounds_fullscreen = window->bounds(); | 589 gfx::Rect bounds_fullscreen = window->bounds(); |
| 589 EXPECT_TRUE(widget->IsFullscreen()); | 590 EXPECT_TRUE(widget->IsFullscreen()); |
| 590 EXPECT_NE(bounds_noshelf.ToString(), bounds_fullscreen.ToString()); | 591 EXPECT_NE(bounds_noshelf.ToString(), bounds_fullscreen.ToString()); |
| 591 | 592 |
| 592 // Swipe up. This should show the shelf. | 593 // Swipe up. This should show the shelf. |
| 593 end = below_start - delta; | 594 end = below_start - delta; |
| 594 generator.GestureScrollSequenceWithCallback(below_start, end, | 595 generator.GestureScrollSequenceWithCallback(below_start, end, |
| 595 base::TimeDelta::FromMilliseconds(10), kNumScrollSteps, | 596 base::TimeDelta::FromMilliseconds(10), kNumScrollSteps, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 607 base::TimeDelta::FromMilliseconds(10), kNumScrollSteps, | 608 base::TimeDelta::FromMilliseconds(10), kNumScrollSteps, |
| 608 base::Bind(&ShelfDragCallback::ProcessScroll, | 609 base::Bind(&ShelfDragCallback::ProcessScroll, |
| 609 base::Unretained(&handler))); | 610 base::Unretained(&handler))); |
| 610 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); | 611 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state()); |
| 611 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); | 612 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state()); |
| 612 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); | 613 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); |
| 613 EXPECT_EQ(shelf_hidden.ToString(), | 614 EXPECT_EQ(shelf_hidden.ToString(), |
| 614 GetShelfWidget()->GetWindowBoundsInScreen().ToString()); | 615 GetShelfWidget()->GetWindowBoundsInScreen().ToString()); |
| 615 EXPECT_EQ(bounds_fullscreen.ToString(), window->bounds().ToString()); | 616 EXPECT_EQ(bounds_fullscreen.ToString(), window->bounds().ToString()); |
| 616 | 617 |
| 617 // Put the window into fullscreen without any chrome at all (eg tab | 618 // Put the window into immersive fullscreen without any chrome at all |
| 618 // fullscreen). | 619 // (browser immersive fullscreen + tab fullscreen). |
| 619 window->SetProperty(ash::internal::kFullscreenUsesMinimalChromeKey, false); | 620 window->SetProperty(ash::internal::kFullscreenTypeKey, |
| 621 ash::wm::FULLSCREEN_TYPE_IMMERSIVE_NO_CHROME); |
| 620 shelf->UpdateVisibilityState(); | 622 shelf->UpdateVisibilityState(); |
| 621 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); | 623 EXPECT_EQ(SHELF_HIDDEN, shelf->visibility_state()); |
| 622 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); | 624 EXPECT_EQ(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, shelf->auto_hide_behavior()); |
| 623 | 625 |
| 624 // Swipe-up. This should not change anything. | 626 // Swipe-up. This should not change anything. |
| 625 end = start - delta; | 627 end = start - delta; |
| 626 generator.GestureScrollSequenceWithCallback(below_start, end, | 628 generator.GestureScrollSequenceWithCallback(below_start, end, |
| 627 base::TimeDelta::FromMilliseconds(10), kNumScrollSteps, | 629 base::TimeDelta::FromMilliseconds(10), kNumScrollSteps, |
| 628 base::Bind(&ShelfDragCallback::ProcessScroll, | 630 base::Bind(&ShelfDragCallback::ProcessScroll, |
| 629 base::Unretained(&handler))); | 631 base::Unretained(&handler))); |
| (...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); | 1873 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); |
| 1872 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | 1874 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
| 1873 generator.ClickLeftButton(); | 1875 generator.ClickLeftButton(); |
| 1874 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); | 1876 EXPECT_TRUE(status_area_widget->IsMessageBubbleShown()); |
| 1875 generator.ClickLeftButton(); | 1877 generator.ClickLeftButton(); |
| 1876 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); | 1878 EXPECT_FALSE(status_area_widget->IsMessageBubbleShown()); |
| 1877 } | 1879 } |
| 1878 | 1880 |
| 1879 } // namespace internal | 1881 } // namespace internal |
| 1880 } // namespace ash | 1882 } // namespace ash |
| OLD | NEW |