Commit 9a43862c authored by ananta@chromium.org's avatar ananta@chromium.org

On Windows ASH ensure that we get the display created for the root window serving ASH.

This ensures that windows created in ASH honor the shell work area etc.

We have bugs today where in the first maximized window in ASH does not honor the work area
leading to problems.

Changes as below:-
1. Added a function IsAshProcess for Windows in ash_init.cc. This returns true if the browser
   is launched to serve ASH.
2. In the DefaultTargetDisplayProvider::GetTargetDisplay function check if the browser is launched
   for ASH along with the check for whether ASH is to be opened on startup. If yes then we get the
   display for the root window created for ASH.

BUG=361776
R=sky

Review URL: https://codereview.chromium.org/348513002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278534 0039d316-1c4b-4281-b951-d872f2087c98
parent 2df18842
......@@ -146,8 +146,16 @@ class DefaultTargetDisplayProvider : public WindowSizer::TargetDisplayProvider {
const gfx::Screen* screen,
const gfx::Rect& bounds) const OVERRIDE {
#if defined(USE_ASH)
bool force_ash = false;
// On Windows check if the browser is launched to serve ASH. If yes then
// we should get the display for the corresponding root window created for
// ASH. This ensures that the display gets the correct workarea, etc.
#if defined(OS_WIN)
force_ash =
CommandLine::ForCurrentProcess()->HasSwitch(switches::kViewerConnect);
#endif
// Use the target display on ash.
if (chrome::ShouldOpenAshOnStartup()) {
if (chrome::ShouldOpenAshOnStartup() || force_ash) {
aura::Window* target = ash::Shell::GetTargetRootWindow();
return screen->GetDisplayNearestWindow(target);
}
......
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