| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 5 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 class DefaultTargetDisplayProvider : public WindowSizer::TargetDisplayProvider { | 154 class DefaultTargetDisplayProvider : public WindowSizer::TargetDisplayProvider { |
| 155 public: | 155 public: |
| 156 DefaultTargetDisplayProvider() {} | 156 DefaultTargetDisplayProvider() {} |
| 157 ~DefaultTargetDisplayProvider() override {} | 157 ~DefaultTargetDisplayProvider() override {} |
| 158 | 158 |
| 159 display::Display GetTargetDisplay(const display::Screen* screen, | 159 display::Display GetTargetDisplay(const display::Screen* screen, |
| 160 const gfx::Rect& bounds) const override { | 160 const gfx::Rect& bounds) const override { |
| 161 #if defined(USE_ASH) | 161 #if defined(USE_ASH) |
| 162 // Use the target display on ash. | 162 // Use the target display on ash. |
| 163 if (ash_util::ShouldOpenAshOnStartup()) { | 163 if (ash_util::ShouldOpenAshOnStartup()) { |
| 164 aura::Window* target = ash::Shell::GetTargetRootWindow(); | 164 aura::Window* target = ash::Shell::GetRootWindowForNewWindows(); |
| 165 return screen->GetDisplayNearestWindow(target); | 165 return screen->GetDisplayNearestWindow(target); |
| 166 } | 166 } |
| 167 #endif | 167 #endif |
| 168 // Find the size of the work area of the monitor that intersects the bounds | 168 // Find the size of the work area of the monitor that intersects the bounds |
| 169 // of the anchor window. | 169 // of the anchor window. |
| 170 return screen->GetDisplayMatching(bounds); | 170 return screen->GetDisplayMatching(bounds); |
| 171 } | 171 } |
| 172 | 172 |
| 173 private: | 173 private: |
| 174 DISALLOW_COPY_AND_ASSIGN(DefaultTargetDisplayProvider); | 174 DISALLOW_COPY_AND_ASSIGN(DefaultTargetDisplayProvider); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 430 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 431 switches::kStartMaximized)) | 431 switches::kStartMaximized)) |
| 432 return ui::SHOW_STATE_MAXIMIZED; | 432 return ui::SHOW_STATE_MAXIMIZED; |
| 433 | 433 |
| 434 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) | 434 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) |
| 435 return browser_->initial_show_state(); | 435 return browser_->initial_show_state(); |
| 436 | 436 |
| 437 // Otherwise we use the default which can be overridden later on. | 437 // Otherwise we use the default which can be overridden later on. |
| 438 return ui::SHOW_STATE_DEFAULT; | 438 return ui::SHOW_STATE_DEFAULT; |
| 439 } | 439 } |
| OLD | NEW |