Commit a6922516 authored by Xiaoqian Dai's avatar Xiaoqian Dai Committed by Commit Bot

Do not allow window dragging/resizing in oobe or login screen.

Bug: 1066467
Change-Id: I23114012b994684004a5553fea74f31795030bd9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144841Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758419}
parent a1d7cbd7
......@@ -290,9 +290,15 @@ 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())
// When running in single app mode or not in an active user session, we
// should not create window resizer.
SessionControllerImpl* session_controller =
Shell::Get()->session_controller();
if (session_controller->IsRunningInAppMode() ||
session_controller->GetSessionState() !=
session_manager::SessionState::ACTIVE) {
return nullptr;
}
if (window_state->IsPip()) {
window_state->CreateDragDetails(point_in_parent, window_component, source);
......
......@@ -1951,4 +1951,22 @@ TEST_F(WorkspaceWindowResizerTest, DoesNotWorkInAppMode) {
EXPECT_FALSE(CreateResizerForTest(window_.get(), gfx::Point(), HTCAPTION));
}
TEST_F(WorkspaceWindowResizerTest, DoNotCreateResizerIfNotActiveSession) {
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::OOBE);
EXPECT_FALSE(CreateResizerForTest(window_.get(), gfx::Point(), HTCAPTION));
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOCKED);
EXPECT_FALSE(CreateResizerForTest(window_.get(), gfx::Point(), HTCAPTION));
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOGIN_PRIMARY);
EXPECT_FALSE(CreateResizerForTest(window_.get(), gfx::Point(), HTCAPTION));
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::ACTIVE);
EXPECT_TRUE(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