| 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 15 matching lines...) Expand all Loading... |
| 26 #include "ui/views/corewm/corewm_switches.h" | 26 #include "ui/views/corewm/corewm_switches.h" |
| 27 #include "ui/views/corewm/input_method_event_filter.h" | 27 #include "ui/views/corewm/input_method_event_filter.h" |
| 28 #include "ui/views/corewm/shadow_controller.h" | 28 #include "ui/views/corewm/shadow_controller.h" |
| 29 #include "ui/views/corewm/shadow_types.h" | 29 #include "ui/views/corewm/shadow_types.h" |
| 30 #include "ui/views/corewm/tooltip_controller.h" | 30 #include "ui/views/corewm/tooltip_controller.h" |
| 31 #include "ui/views/corewm/visibility_controller.h" | 31 #include "ui/views/corewm/visibility_controller.h" |
| 32 #include "ui/views/corewm/window_modality_controller.h" | 32 #include "ui/views/corewm/window_modality_controller.h" |
| 33 #include "ui/views/drag_utils.h" | 33 #include "ui/views/drag_utils.h" |
| 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/view_constants_aura.h" |
| 36 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" | 37 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" |
| 37 #include "ui/views/widget/drop_helper.h" | 38 #include "ui/views/widget/drop_helper.h" |
| 38 #include "ui/views/widget/native_widget_aura_window_observer.h" | 39 #include "ui/views/widget/native_widget_aura_window_observer.h" |
| 40 #include "ui/views/widget/native_widget_layer_reorderer_aura.h" |
| 39 #include "ui/views/widget/root_view.h" | 41 #include "ui/views/widget/root_view.h" |
| 40 #include "ui/views/widget/tooltip_manager_aura.h" | 42 #include "ui/views/widget/tooltip_manager_aura.h" |
| 41 #include "ui/views/widget/widget.h" | 43 #include "ui/views/widget/widget.h" |
| 42 #include "ui/views/widget/widget_aura_utils.h" | 44 #include "ui/views/widget/widget_aura_utils.h" |
| 43 #include "ui/views/widget/widget_delegate.h" | 45 #include "ui/views/widget/widget_delegate.h" |
| 44 | 46 |
| 45 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(VIEWS_EXPORT, | 47 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(VIEWS_EXPORT, |
| 46 views::DesktopNativeWidgetAura*); | 48 views::DesktopNativeWidgetAura*); |
| 47 | 49 |
| 48 namespace views { | 50 namespace views { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 265 } |
| 264 | 266 |
| 265 window_->Show(); | 267 window_->Show(); |
| 266 desktop_root_window_host_->InitFocus(window_); | 268 desktop_root_window_host_->InitFocus(window_); |
| 267 | 269 |
| 268 aura::client::SetActivationDelegate(window_, this); | 270 aura::client::SetActivationDelegate(window_, this); |
| 269 | 271 |
| 270 shadow_controller_.reset( | 272 shadow_controller_.reset( |
| 271 new corewm::ShadowController( | 273 new corewm::ShadowController( |
| 272 aura::client::GetActivationClient(root_window_.get()))); | 274 aura::client::GetActivationClient(root_window_.get()))); |
| 275 |
| 276 layer_reorderer_.reset(new NativeWidgetLayerReordererAura( |
| 277 window_, GetWidget()->GetRootView())); |
| 273 } | 278 } |
| 274 | 279 |
| 275 NonClientFrameView* DesktopNativeWidgetAura::CreateNonClientFrameView() { | 280 NonClientFrameView* DesktopNativeWidgetAura::CreateNonClientFrameView() { |
| 276 return desktop_root_window_host_->CreateNonClientFrameView(); | 281 return desktop_root_window_host_->CreateNonClientFrameView(); |
| 277 } | 282 } |
| 278 | 283 |
| 279 bool DesktopNativeWidgetAura::ShouldUseNativeFrame() const { | 284 bool DesktopNativeWidgetAura::ShouldUseNativeFrame() const { |
| 280 return desktop_root_window_host_->ShouldUseNativeFrame(); | 285 return desktop_root_window_host_->ShouldUseNativeFrame(); |
| 281 } | 286 } |
| 282 | 287 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 309 } | 314 } |
| 310 | 315 |
| 311 ui::Compositor* DesktopNativeWidgetAura::GetCompositor() { | 316 ui::Compositor* DesktopNativeWidgetAura::GetCompositor() { |
| 312 return window_->layer()->GetCompositor(); | 317 return window_->layer()->GetCompositor(); |
| 313 } | 318 } |
| 314 | 319 |
| 315 ui::Layer* DesktopNativeWidgetAura::GetLayer() { | 320 ui::Layer* DesktopNativeWidgetAura::GetLayer() { |
| 316 return window_->layer(); | 321 return window_->layer(); |
| 317 } | 322 } |
| 318 | 323 |
| 324 void DesktopNativeWidgetAura::ReorderLayersForAttachedNativeViews() { |
| 325 layer_reorderer_->ReorderChildWindowLayers(); |
| 326 } |
| 327 |
| 319 void DesktopNativeWidgetAura::ViewRemoved(View* view) { | 328 void DesktopNativeWidgetAura::ViewRemoved(View* view) { |
| 320 } | 329 } |
| 321 | 330 |
| 322 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, | 331 void DesktopNativeWidgetAura::SetNativeWindowProperty(const char* name, |
| 323 void* value) { | 332 void* value) { |
| 324 window_->SetNativeWindowProperty(name, value); | 333 window_->SetNativeWindowProperty(name, value); |
| 325 } | 334 } |
| 326 | 335 |
| 327 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { | 336 void* DesktopNativeWidgetAura::GetNativeWindowProperty(const char* name) const { |
| 328 return window_->GetNativeWindowProperty(name); | 337 return window_->GetNativeWindowProperty(name); |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 drop_helper_->OnDragExit(); | 845 drop_helper_->OnDragExit(); |
| 837 } | 846 } |
| 838 | 847 |
| 839 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { | 848 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { |
| 840 DCHECK(drop_helper_.get() != NULL); | 849 DCHECK(drop_helper_.get() != NULL); |
| 841 return drop_helper_->OnDrop(event.data(), event.location(), | 850 return drop_helper_->OnDrop(event.data(), event.location(), |
| 842 last_drop_operation_); | 851 last_drop_operation_); |
| 843 } | 852 } |
| 844 | 853 |
| 845 } // namespace views | 854 } // namespace views |
| OLD | NEW |