| 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/desktop/desktop_activation_client.h" | 8 #include "ui/aura/desktop/desktop_activation_client.h" |
| 9 #include "ui/aura/desktop/desktop_cursor_client.h" | 9 #include "ui/aura/desktop/desktop_cursor_client.h" |
| 10 #include "ui/aura/desktop/desktop_dispatcher_client.h" | 10 #include "ui/aura/desktop/desktop_dispatcher_client.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 widget_->GetWidget())); | 165 widget_->GetWidget())); |
| 166 ui::HWNDSubclass::AddFilterToTarget(root_window_->GetAcceleratedWidget(), | 166 ui::HWNDSubclass::AddFilterToTarget(root_window_->GetAcceleratedWidget(), |
| 167 hwnd_message_filter_.get()); | 167 hwnd_message_filter_.get()); |
| 168 #endif | 168 #endif |
| 169 } | 169 } |
| 170 | 170 |
| 171 aura::RootWindow* DesktopNativeWidgetHelperAura::GetRootWindow() { | 171 aura::RootWindow* DesktopNativeWidgetHelperAura::GetRootWindow() { |
| 172 return root_window_.get(); | 172 return root_window_.get(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void DesktopNativeWidgetHelperAura::OnWindowDestroying(aura::Window* window) { |
| 176 window_->RemoveObserver(this); |
| 177 window_ = NULL; |
| 178 } |
| 179 |
| 175 gfx::Rect DesktopNativeWidgetHelperAura::ModifyAndSetBounds( | 180 gfx::Rect DesktopNativeWidgetHelperAura::ModifyAndSetBounds( |
| 176 const gfx::Rect& bounds) { | 181 const gfx::Rect& bounds) { |
| 177 gfx::Rect out_bounds = bounds; | 182 gfx::Rect out_bounds = bounds; |
| 178 if (root_window_.get() && !out_bounds.IsEmpty()) { | 183 if (root_window_.get() && !out_bounds.IsEmpty()) { |
| 179 // TODO(scottmg): This avoids the AdjustWindowRect that ash wants to | 184 // TODO(scottmg): This avoids the AdjustWindowRect that ash wants to |
| 180 // adjust the top level on Windows. | 185 // adjust the top level on Windows. |
| 181 #if !defined(OS_WIN) | 186 #if !defined(OS_WIN) |
| 182 root_window_->SetHostBounds(out_bounds); | 187 root_window_->SetHostBounds(out_bounds); |
| 183 #endif | 188 #endif |
| 184 out_bounds.set_x(0); | 189 out_bounds.set_x(0); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 widget_->GetWidget()->Close(); | 233 widget_->GetWidget()->Close(); |
| 229 } | 234 } |
| 230 | 235 |
| 231 void DesktopNativeWidgetHelperAura::OnRootWindowMoved( | 236 void DesktopNativeWidgetHelperAura::OnRootWindowMoved( |
| 232 const aura::RootWindow* root, | 237 const aura::RootWindow* root, |
| 233 const gfx::Point& new_origin) { | 238 const gfx::Point& new_origin) { |
| 234 widget_->GetWidget()->OnNativeWidgetMove(); | 239 widget_->GetWidget()->OnNativeWidgetMove(); |
| 235 } | 240 } |
| 236 | 241 |
| 237 } // namespace views | 242 } // namespace views |
| OLD | NEW |