Commit 8ef8c0ed authored by Anatoliy Potapchuk's avatar Anatoliy Potapchuk Committed by Commit Bot

Don't allow kiosk window resize

Previously the tablet resizer was allowing resize of almost all windows,
which caused http://crbug.com/985109. Now it actually works as intended.

Bug: 985109
Change-Id: Ibcac57f9a1dbd56c89925e3280723a7026d3683a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1758448Reviewed-by: default avatarJun Mukai <mukai@chromium.org>
Commit-Queue: Anatoliy Potapchuk <apotapchuk@chromium.org>
Auto-Submit: Anatoliy Potapchuk <apotapchuk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690201}
parent 4e724d5b
......@@ -14,6 +14,7 @@
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
#include "ash/session/session_controller_impl.h"
#include "ash/shell.h"
#include "ash/wm/default_window_resizer.h"
#include "ash/wm/desks/desks_util.h"
......@@ -143,6 +144,10 @@ std::unique_ptr<WindowResizer> CreateWindowResizer(
if (window_state->drag_details())
return nullptr;
// When running in single app mode, we should not create window resizer.
if (Shell::Get()->session_controller()->IsRunningInAppMode())
return nullptr;
if (window_state->IsPip()) {
window_state->CreateDragDetails(point_in_parent, window_component, source);
return std::make_unique<PipWindowResizer>(window_state);
......
......@@ -1927,4 +1927,10 @@ TEST_F(MultiDisplayWorkspaceWindowResizerTest, Magnetism) {
EXPECT_EQ(gfx::Rect(1150, 10, 100, 100), win1->GetBoundsInScreen());
}
// Makes sure that we are not creating any resizer in kiosk mode.
TEST_F(WorkspaceWindowResizerTest, DoesNotWorkInAppMode) {
GetSessionControllerClient()->SetIsRunningInAppMode(true);
EXPECT_FALSE(CreateResizerForTest(window_.get(), gfx::Point(), HTCAPTION));
}
} // 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