Commit 8a8279bc authored by Avery Musbach's avatar Avery Musbach Committed by Commit Bot

overview: Bail from GetSplitviewBoundsMaintainingAspectRatio in clamshell

The functionality of GetSplitviewBoundsMaintainingAspectRatio is only
intended for tablet mode, but before the present CL, it also operates in
clamshell mode. Like almost all code that is specific to tablet mode, it
assumes that there is only one root window (see the header comment on
SplitViewController::Get). This assumption causes blatantly broken
behavior in clamshell mode.

Fixed: 1035186
Change-Id: Ic7f97aaa1a13973e7c3b7bfbee22b41f14597acb
Bug: 1035186
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1978840
Commit-Queue: Avery Musbach <amusbach@chromium.org>
Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726970}
parent b421c3a6
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "ash/wm/overview/scoped_overview_animation_settings.h" #include "ash/wm/overview/scoped_overview_animation_settings.h"
#include "ash/wm/splitview/split_view_controller.h" #include "ash/wm/splitview/split_view_controller.h"
#include "ash/wm/splitview/split_view_utils.h" #include "ash/wm/splitview/split_view_utils.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "ash/wm/window_state.h" #include "ash/wm/window_state.h"
#include "ash/wm/window_transient_descendant_iterator.h" #include "ash/wm/window_transient_descendant_iterator.h"
#include "ash/wm/wm_event.h" #include "ash/wm/wm_event.h"
...@@ -262,6 +263,8 @@ base::Optional<gfx::RectF> GetSplitviewBoundsMaintainingAspectRatio( ...@@ -262,6 +263,8 @@ base::Optional<gfx::RectF> GetSplitviewBoundsMaintainingAspectRatio(
aura::Window* window) { aura::Window* window) {
if (!ShouldAllowSplitView()) if (!ShouldAllowSplitView())
return base::nullopt; return base::nullopt;
if (!Shell::Get()->tablet_mode_controller()->InTabletMode())
return base::nullopt;
auto* overview_session = auto* overview_session =
Shell::Get()->overview_controller()->overview_session(); Shell::Get()->overview_controller()->overview_session();
DCHECK(overview_session); DCHECK(overview_session);
......
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