X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fui%2Fwindow_sizer%2Fwindow_sizer.cc;h=34b342b05985c9642d5765b902271582633b2974;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=ac5486fb7cbb748ccb608a62a15e3cc6039f54f9;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/ui/window_sizer/window_sizer.cc b/src/chrome/browser/ui/window_sizer/window_sizer.cc index ac5486f..34b342b 100644 --- a/src/chrome/browser/ui/window_sizer/window_sizer.cc +++ b/src/chrome/browser/ui/window_sizer/window_sizer.cc @@ -146,8 +146,23 @@ 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 the ASH shell does not exist then the current behavior is to open + // browser windows if any on the desktop. Preserve that for now. + // TODO(ananta). + // This effectively means that the running browser process is in a split + // personality mode, part of it running in ASH and the other running in + // desktop. This may cause apps and other widgets to not work correctly. + // Revisit and address. +#if defined(OS_WIN) + force_ash = ash::Shell::HasInstance() && + 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); }