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_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "ui/aura/client/activation_client.h" | 8 #include "ui/aura/client/activation_client.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/stacking_client.h" | 10 #include "ui/aura/client/stacking_client.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "ui/views/ime/input_method.h" | 34 #include "ui/views/ime/input_method.h" |
35 #include "ui/views/ime/input_method_bridge.h" | 35 #include "ui/views/ime/input_method_bridge.h" |
36 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" | 36 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" |
37 #include "ui/views/widget/drop_helper.h" | 37 #include "ui/views/widget/drop_helper.h" |
38 #include "ui/views/widget/native_widget_aura_window_observer.h" | 38 #include "ui/views/widget/native_widget_aura_window_observer.h" |
39 #include "ui/views/widget/root_view.h" | 39 #include "ui/views/widget/root_view.h" |
40 #include "ui/views/widget/tooltip_manager_aura.h" | 40 #include "ui/views/widget/tooltip_manager_aura.h" |
41 #include "ui/views/widget/widget.h" | 41 #include "ui/views/widget/widget.h" |
42 #include "ui/views/widget/widget_aura_utils.h" | 42 #include "ui/views/widget/widget_aura_utils.h" |
43 #include "ui/views/widget/widget_delegate.h" | 43 #include "ui/views/widget/widget_delegate.h" |
| 44 #include "ui/views/widget/window_reorderer.h" |
44 | 45 |
45 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(VIEWS_EXPORT, | 46 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(VIEWS_EXPORT, |
46 views::DesktopNativeWidgetAura*); | 47 views::DesktopNativeWidgetAura*); |
47 | 48 |
48 namespace views { | 49 namespace views { |
49 | 50 |
50 DEFINE_WINDOW_PROPERTY_KEY(DesktopNativeWidgetAura*, | 51 DEFINE_WINDOW_PROPERTY_KEY(DesktopNativeWidgetAura*, |
51 kDesktopNativeWidgetAuraKey, NULL); | 52 kDesktopNativeWidgetAuraKey, NULL); |
52 | 53 |
53 namespace { | 54 namespace { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 268 } |
268 | 269 |
269 window_->Show(); | 270 window_->Show(); |
270 desktop_root_window_host_->InitFocus(window_); | 271 desktop_root_window_host_->InitFocus(window_); |
271 | 272 |
272 aura::client::SetActivationDelegate(window_, this); | 273 aura::client::SetActivationDelegate(window_, this); |
273 | 274 |
274 shadow_controller_.reset( | 275 shadow_controller_.reset( |
275 new corewm::ShadowController( | 276 new corewm::ShadowController( |
276 aura::client::GetActivationClient(root_window_.get()))); | 277 aura::client::GetActivationClient(root_window_.get()))); |
| 278 |
| 279 window_reorderer_.reset(new WindowReorderer(window_, |
| 280 GetWidget()->GetRootView())); |
277 } | 281 } |
278 | 282 |
279 NonClientFrameView* DesktopNativeWidgetAura::CreateNonClientFrameView() { | 283 NonClientFrameView* DesktopNativeWidgetAura::CreateNonClientFrameView() { |
280 return desktop_root_window_host_->CreateNonClientFrameView(); | 284 return desktop_root_window_host_->CreateNonClientFrameView(); |
281 } | 285 } |
282 | 286 |
283 bool DesktopNativeWidgetAura::ShouldUseNativeFrame() const { | 287 bool DesktopNativeWidgetAura::ShouldUseNativeFrame() const { |
284 return desktop_root_window_host_->ShouldUseNativeFrame(); | 288 return desktop_root_window_host_->ShouldUseNativeFrame(); |
285 } | 289 } |
286 | 290 |
(...skipping 26 matching lines...) Expand all Loading... |
313 } | 317 } |
314 | 318 |
315 ui::Compositor* DesktopNativeWidgetAura::GetCompositor() { | 319 ui::Compositor* DesktopNativeWidgetAura::GetCompositor() { |
316 return window_->layer()->GetCompositor(); | 320 return window_->layer()->GetCompositor(); |
317 } | 321 } |
318 | 322 |
319 ui::Layer* DesktopNativeWidgetAura::GetLayer() { | 323 ui::Layer* DesktopNativeWidgetAura::GetLayer() { |
320 return window_->layer(); | 324 return window_->layer(); |
321 } | 325 } |
322 | 326 |
| 327 void DesktopNativeWidgetAura::ReorderNativeViews() { |
| 328 window_reorderer_->ReorderChildWindows(); |
| 329 } |
| 330 |
323 void DesktopNativeWidgetAura::ViewRemoved(View* view) { | 331 void DesktopNativeWidgetAura::ViewRemoved(View* view) { |
324 } | 332 } |
325 | 333 |
326 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, | 334 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, |
327 void* value) { | 335 void* value) { |
328 window_->SetNativeWindowProperty(name, value); | 336 window_->SetNativeWindowProperty(name, value); |
329 } | 337 } |
330 | 338 |
331 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { | 339 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { |
332 return window_->GetNativeWindowProperty(name); | 340 return window_->GetNativeWindowProperty(name); |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 | 856 |
849 //////////////////////////////////////////////////////////////////////////////// | 857 //////////////////////////////////////////////////////////////////////////////// |
850 // DesktopNativeWidgetAura, aura::RootWindowObserver implementation: | 858 // DesktopNativeWidgetAura, aura::RootWindowObserver implementation: |
851 | 859 |
852 void DesktopNativeWidgetAura::OnRootWindowHostCloseRequested( | 860 void DesktopNativeWidgetAura::OnRootWindowHostCloseRequested( |
853 const aura::RootWindow* root) { | 861 const aura::RootWindow* root) { |
854 Close(); | 862 Close(); |
855 } | 863 } |
856 | 864 |
857 } // namespace views | 865 } // namespace views |
OLD | NEW |