| 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 "ui/views/widget/desktop_native_widget_helper_aura.h" | 5 #include "ui/views/widget/desktop_native_widget_helper_aura.h" |
| 6 | 6 |
| 7 #include "ui/aura/client/dispatcher_client.h" | 7 #include "ui/aura/client/dispatcher_client.h" |
| 8 #include "ui/aura/client/screen_position_client.h" | 8 #include "ui/aura/client/screen_position_client.h" |
| 9 #include "ui/aura/cursor_manager.h" | 9 #include "ui/aura/cursor_manager.h" |
| 10 #include "ui/aura/desktop/desktop_activation_client.h" | 10 #include "ui/aura/desktop/desktop_activation_client.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } | 191 } |
| 192 | 192 |
| 193 aura::RootWindow* DesktopNativeWidgetHelperAura::GetRootWindow() { | 193 aura::RootWindow* DesktopNativeWidgetHelperAura::GetRootWindow() { |
| 194 return root_window_.get(); | 194 return root_window_.get(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 gfx::Rect DesktopNativeWidgetHelperAura::ModifyAndSetBounds( | 197 gfx::Rect DesktopNativeWidgetHelperAura::ModifyAndSetBounds( |
| 198 const gfx::Rect& bounds) { | 198 const gfx::Rect& bounds) { |
| 199 gfx::Rect out_bounds = bounds; | 199 gfx::Rect out_bounds = bounds; |
| 200 if (root_window_.get() && !out_bounds.IsEmpty()) { | 200 if (root_window_.get() && !out_bounds.IsEmpty()) { |
| 201 // TODO(scottmg): This avoids the AdjustWindowRect that ash wants to |
| 202 // adjust the top level on Windows. |
| 203 #if !defined(OS_WIN) |
| 201 root_window_->SetHostBounds(out_bounds); | 204 root_window_->SetHostBounds(out_bounds); |
| 205 #endif |
| 202 out_bounds.set_x(0); | 206 out_bounds.set_x(0); |
| 203 out_bounds.set_y(0); | 207 out_bounds.set_y(0); |
| 204 } else if (is_embedded_window_) { | 208 } else if (is_embedded_window_) { |
| 205 // The caller expects windows we consider "embedded" to be placed in the | 209 // The caller expects windows we consider "embedded" to be placed in the |
| 206 // screen coordinate system. So we need to offset the root window's | 210 // screen coordinate system. So we need to offset the root window's |
| 207 // position (which is in screen coordinates) from these bounds. | 211 // position (which is in screen coordinates) from these bounds. |
| 208 aura::RootWindow* root = | 212 aura::RootWindow* root = |
| 209 widget_->GetNativeWindow()->GetRootWindow()->GetRootWindow(); | 213 widget_->GetNativeWindow()->GetRootWindow()->GetRootWindow(); |
| 210 gfx::Point point = root->GetHostOrigin(); | 214 gfx::Point point = root->GetHostOrigin(); |
| 211 out_bounds.set_x(out_bounds.x() - point.x()); | 215 out_bounds.set_x(out_bounds.x() - point.x()); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 226 root->GetHostSize())); | 230 root->GetHostSize())); |
| 227 } | 231 } |
| 228 | 232 |
| 229 void DesktopNativeWidgetHelperAura::OnRootWindowHostClosed( | 233 void DesktopNativeWidgetHelperAura::OnRootWindowHostClosed( |
| 230 const aura::RootWindow* root) { | 234 const aura::RootWindow* root) { |
| 231 DCHECK_EQ(root, root_window_.get()); | 235 DCHECK_EQ(root, root_window_.get()); |
| 232 widget_->GetWidget()->Close(); | 236 widget_->GetWidget()->Close(); |
| 233 } | 237 } |
| 234 | 238 |
| 235 } // namespace views | 239 } // namespace views |
| OLD | NEW |