Index: chrome/browser/ui/window_sizer/window_sizer.cc |
diff --git a/chrome/browser/ui/window_sizer/window_sizer.cc b/chrome/browser/ui/window_sizer/window_sizer.cc |
index ac5486fb7cbb748ccb608a62a15e3cc6039f54f9..9c957777de9bc0ead0dd84fe3524aa90870b2c53 100644 |
--- a/chrome/browser/ui/window_sizer/window_sizer.cc |
+++ b/chrome/browser/ui/window_sizer/window_sizer.cc |
@@ -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); |
} |