| 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 "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/window_positioner.h" | 8 #include "ash/wm/window_positioner.h" |
| 9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
| 12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 13 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
| 14 #include "ui/gfx/screen.h" | 14 #include "ui/gfx/screen.h" |
| 15 | 15 |
| 16 bool WindowSizer::GetBrowserBoundsAsh(gfx::Rect* bounds, | 16 bool WindowSizer::GetBrowserBoundsAsh(gfx::Rect* bounds, |
| 17 ui::WindowShowState* show_state) const { | 17 ui::WindowShowState* show_state) const { |
| 18 if (!browser_ || | 18 if (!browser_ || browser_->host_desktop_type() != ui::HOST_DESKTOP_TYPE_ASH) |
| 19 browser_->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH) | |
| 20 return false; | 19 return false; |
| 21 | 20 |
| 22 bool determined = false; | 21 bool determined = false; |
| 23 if (bounds->IsEmpty()) { | 22 if (bounds->IsEmpty()) { |
| 24 if (browser_->is_type_tabbed()) { | 23 if (browser_->is_type_tabbed()) { |
| 25 GetTabbedBrowserBoundsAsh(bounds, show_state); | 24 GetTabbedBrowserBoundsAsh(bounds, show_state); |
| 26 determined = true; | 25 determined = true; |
| 27 } else if (browser_->is_trusted_source()) { | 26 } else if (browser_->is_trusted_source()) { |
| 28 // For trusted popups (v1 apps and system windows), do not use the last | 27 // For trusted popups (v1 apps and system windows), do not use the last |
| 29 // active window bounds, only use saved or default bounds. | 28 // active window bounds, only use saved or default bounds. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 browser_->window() ? browser_->window()->GetNativeWindow() : NULL; | 108 browser_->window() ? browser_->window()->GetNativeWindow() : NULL; |
| 110 | 109 |
| 111 ash::WindowPositioner::GetBoundsAndShowStateForNewWindow( | 110 ash::WindowPositioner::GetBoundsAndShowStateForNewWindow( |
| 112 screen_, | 111 screen_, |
| 113 browser_window, | 112 browser_window, |
| 114 is_saved_bounds, | 113 is_saved_bounds, |
| 115 passed_show_state, | 114 passed_show_state, |
| 116 bounds_in_screen, | 115 bounds_in_screen, |
| 117 show_state); | 116 show_state); |
| 118 } | 117 } |
| OLD | NEW |