Commit 2c731c0f authored by Eliot Courtney's avatar Eliot Courtney Committed by Commit Bot

Let PIP windows be resized in tablet mode as well.

free resize it.

Bug: b/113151342
Test: unit test + opened a PIP window in tablet mode and was able to
Change-Id: Ic72478a35c5726e7ffa2e89fd61243b87f4bf4d7
Reviewed-on: https://chromium-review.googlesource.com/1188404Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Eliot Courtney <edcourtney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585876}
parent 5136d353
...@@ -65,7 +65,8 @@ std::unique_ptr<WindowResizer> CreateWindowResizer( ...@@ -65,7 +65,8 @@ std::unique_ptr<WindowResizer> CreateWindowResizer(
if (Shell::Get() if (Shell::Get()
->tablet_mode_controller() ->tablet_mode_controller()
->IsTabletModeWindowManagerEnabled()) { ->IsTabletModeWindowManagerEnabled() &&
!window_state->IsPip()) {
// We still don't allow any dragging or resizing happening on the area other // We still don't allow any dragging or resizing happening on the area other
// then caption area. // then caption area.
if (window_component != HTCAPTION) if (window_component != HTCAPTION)
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/test/ash_test_base.h" #include "ash/test/ash_test_base.h"
#include "ash/window_factory.h" #include "ash/window_factory.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "ash/wm/window_positioning_utils.h" #include "ash/wm/window_positioning_utils.h"
#include "ash/wm/window_state.h" #include "ash/wm/window_state.h"
#include "ash/wm/window_util.h" #include "ash/wm/window_util.h"
...@@ -1903,4 +1904,28 @@ TEST_F(WorkspaceWindowResizerTest, PipCanBeResized) { ...@@ -1903,4 +1904,28 @@ TEST_F(WorkspaceWindowResizerTest, PipCanBeResized) {
EXPECT_EQ("20,30 100x60", fake_state->last_bounds().ToString()); EXPECT_EQ("20,30 100x60", fake_state->last_bounds().ToString());
} }
TEST_F(WorkspaceWindowResizerTest, PipCanBeResizedInTabletMode) {
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
aura::Window* root_window = Shell::GetPrimaryRootWindow();
aura::Window* container =
Shell::GetContainer(root_window, kShellWindowId_AlwaysOnTopContainer);
std::unique_ptr<aura::Window> window(
aura::test::CreateTestWindowWithId(0, container));
window->SetBounds(gfx::Rect(20, 30, 50, 60));
window->Show();
auto* fake_state = new FakeWindowState(mojom::WindowStateType::PIP);
wm::WindowState* window_state = wm::GetWindowState(window.get());
window_state->SetStateObject(
std::unique_ptr<wm::WindowState::State>(fake_state));
std::unique_ptr<WindowResizer> resizer(
CreateResizerForTest(window.get(), gfx::Point(), HTRIGHT));
ASSERT_TRUE(resizer.get());
resizer->Drag(CalculateDragPoint(*resizer, 50, 0), 0);
resizer->CompleteDrag();
EXPECT_EQ("20,30 100x60", fake_state->last_bounds().ToString());
}
} // namespace ash } // namespace ash
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment