Commit 35677217 authored by Shawn Gallea's avatar Shawn Gallea Committed by Commit Bot

EXO: Add GetRootWindowForNewWindows function to wm_helper interface

Added GetRootWindowForNewWindows and implemented in wm_helper_chromeos.
This allows simple retrieval of root window from
window manager, used for setting parent window when creating
widgets (https://chromium-review.googlesource.com/c/chromium/src/+/1298172/20,
fullscreen_shell_surface.cc).

Bug: 896710
Test: Built and ran on ChromeOS
Change-Id: Ie43bea17c31cdf79402fadea441d5bc924e64503
Reviewed-on: https://chromium-review.googlesource.com/c/1302823Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Shawn Gallea <sagallea@google.com>
Cr-Commit-Position: refs/heads/master@{#605806}
parent 18308783
......@@ -960,7 +960,8 @@ void ShellSurfaceBase::CreateShellSurfaceWidget(
params.parent =
parent_ ? parent_
: ash::Shell::GetContainer(
ash::Shell::GetRootWindowForNewWindows(), container_);
WMHelper::GetInstance()->GetRootWindowForNewWindows(),
container_);
params.bounds = gfx::Rect(origin_, gfx::Size());
bool activatable = activatable_;
// ShellSurfaces in system modal container are only activatable if input
......
......@@ -91,6 +91,7 @@ class WMHelper : public aura::client::DragDropDelegate {
virtual aura::Window* GetPrimaryDisplayContainer(int container_id) = 0;
virtual aura::Window* GetActiveWindow() const = 0;
virtual aura::Window* GetFocusedWindow() const = 0;
virtual aura::Window* GetRootWindowForNewWindows() const = 0;
virtual aura::client::CursorClient* GetCursorClient() = 0;
virtual void AddPreTargetHandler(ui::EventHandler* handler) = 0;
virtual void PrependPreTargetHandler(ui::EventHandler* handler) = 0;
......
......@@ -170,6 +170,10 @@ aura::Window* WMHelperChromeOS::GetFocusedWindow() const {
return focus_client->GetFocusedWindow();
}
aura::Window* WMHelperChromeOS::GetRootWindowForNewWindows() const {
return ash::Shell::GetRootWindowForNewWindows();
}
aura::client::CursorClient* WMHelperChromeOS::GetCursorClient() {
return aura::client::GetCursorClient(ash::Shell::GetPrimaryRootWindow());
}
......
......@@ -86,6 +86,7 @@ class WMHelperChromeOS : public WMHelper {
aura::Window* GetPrimaryDisplayContainer(int container_id) override;
aura::Window* GetActiveWindow() const override;
aura::Window* GetFocusedWindow() const override;
aura::Window* GetRootWindowForNewWindows() const override;
aura::client::CursorClient* GetCursorClient() override;
void AddPreTargetHandler(ui::EventHandler* handler) override;
void PrependPreTargetHandler(ui::EventHandler* handler) override;
......
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