| 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_window_tree_host_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
| 9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 30 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 31 #include "ui/views/widget/root_view.h" | 31 #include "ui/views/widget/root_view.h" |
| 32 #include "ui/views/widget/widget_delegate.h" | 32 #include "ui/views/widget/widget_delegate.h" |
| 33 #include "ui/views/widget/widget_hwnd_utils.h" | 33 #include "ui/views/widget/widget_hwnd_utils.h" |
| 34 #include "ui/views/win/fullscreen_handler.h" | 34 #include "ui/views/win/fullscreen_handler.h" |
| 35 #include "ui/views/win/hwnd_message_handler.h" | 35 #include "ui/views/win/hwnd_message_handler.h" |
| 36 #include "ui/views/win/hwnd_util.h" | 36 #include "ui/views/win/hwnd_util.h" |
| 37 #include "ui/views/window/native_frame_view.h" | 37 #include "ui/views/window/native_frame_view.h" |
| 38 #include "ui/wm/core/compound_event_filter.h" | 38 #include "ui/wm/core/compound_event_filter.h" |
| 39 #include "ui/wm/core/window_animations.h" | 39 #include "ui/wm/core/window_animations.h" |
| 40 #include "ui/wm/core/window_util.h" |
| 40 #include "ui/wm/public/scoped_tooltip_disabler.h" | 41 #include "ui/wm/public/scoped_tooltip_disabler.h" |
| 41 | 42 |
| 42 DECLARE_WINDOW_PROPERTY_TYPE(views::DesktopWindowTreeHostWin*); | 43 DECLARE_WINDOW_PROPERTY_TYPE(views::DesktopWindowTreeHostWin*); |
| 43 | 44 |
| 44 namespace views { | 45 namespace views { |
| 45 | 46 |
| 46 namespace { | 47 namespace { |
| 47 | 48 |
| 48 gfx::Size GetExpandedWindowSize(DWORD window_style, gfx::Size size) { | 49 gfx::Size GetExpandedWindowSize(DWORD window_style, gfx::Size size) { |
| 49 if (!(window_style & WS_EX_COMPOSITED) || !ui::win::IsAeroGlassEnabled()) | 50 if (!(window_style & WS_EX_COMPOSITED) || !ui::win::IsAeroGlassEnabled()) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 content_window_ = content_window; | 113 content_window_ = content_window; |
| 113 wants_mouse_events_when_inactive_ = params.wants_mouse_events_when_inactive; | 114 wants_mouse_events_when_inactive_ = params.wants_mouse_events_when_inactive; |
| 114 | 115 |
| 115 aura::client::SetAnimationHost(content_window_, this); | 116 aura::client::SetAnimationHost(content_window_, this); |
| 116 | 117 |
| 117 ConfigureWindowStyles(message_handler_.get(), params, | 118 ConfigureWindowStyles(message_handler_.get(), params, |
| 118 GetWidget()->widget_delegate(), | 119 GetWidget()->widget_delegate(), |
| 119 native_widget_delegate_); | 120 native_widget_delegate_); |
| 120 | 121 |
| 121 HWND parent_hwnd = NULL; | 122 HWND parent_hwnd = NULL; |
| 122 if (params.parent && params.parent->GetHost()) | 123 if (params.parent && params.parent->GetHost()) { |
| 123 parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget(); | 124 parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget(); |
| 125 wm::AddTransientChild(params.parent, content_window_); |
| 126 } |
| 124 | 127 |
| 125 remove_standard_frame_ = params.remove_standard_frame; | 128 remove_standard_frame_ = params.remove_standard_frame; |
| 126 has_non_client_view_ = Widget::RequiresNonClientView(params.type); | 129 has_non_client_view_ = Widget::RequiresNonClientView(params.type); |
| 127 | 130 |
| 128 // We don't have an HWND yet, so scale relative to the nearest screen. | 131 // We don't have an HWND yet, so scale relative to the nearest screen. |
| 129 gfx::Rect pixel_bounds = | 132 gfx::Rect pixel_bounds = |
| 130 display::win::ScreenWin::DIPToScreenRect(nullptr, params.bounds); | 133 display::win::ScreenWin::DIPToScreenRect(nullptr, params.bounds); |
| 131 message_handler_->Init(parent_hwnd, pixel_bounds); | 134 message_handler_->Init(parent_hwnd, pixel_bounds); |
| 132 if (params.force_software_compositing) { | 135 if (params.force_software_compositing) { |
| 133 ::SetProp(GetAcceleratedWidget(), | 136 ::SetProp(GetAcceleratedWidget(), |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 | 994 |
| 992 // static | 995 // static |
| 993 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 996 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
| 994 internal::NativeWidgetDelegate* native_widget_delegate, | 997 internal::NativeWidgetDelegate* native_widget_delegate, |
| 995 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 998 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 996 return new DesktopWindowTreeHostWin(native_widget_delegate, | 999 return new DesktopWindowTreeHostWin(native_widget_delegate, |
| 997 desktop_native_widget_aura); | 1000 desktop_native_widget_aura); |
| 998 } | 1001 } |
| 999 | 1002 |
| 1000 } // namespace views | 1003 } // namespace views |
| OLD | NEW |