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 "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
8 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
9 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/cursor_client.h" | 11 #include "ui/aura/client/cursor_client.h" |
11 #include "ui/aura/client/focus_client.h" | 12 #include "ui/aura/client/focus_client.h" |
12 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
13 #include "ui/aura/window_property.h" | 14 #include "ui/aura/window_property.h" |
14 #include "ui/base/cursor/cursor_loader_win.h" | 15 #include "ui/base/cursor/cursor_loader_win.h" |
15 #include "ui/base/ime/input_method.h" | 16 #include "ui/base/ime/input_method.h" |
16 #include "ui/base/win/shell.h" | 17 #include "ui/base/win/shell.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 window()->SetProperty(kDesktopWindowTreeHostKey, this); | 164 window()->SetProperty(kDesktopWindowTreeHostKey, this); |
164 | 165 |
165 should_animate_window_close_ = | 166 should_animate_window_close_ = |
166 content_window_->type() != ui::wm::WINDOW_TYPE_NORMAL && | 167 content_window_->type() != ui::wm::WINDOW_TYPE_NORMAL && |
167 !wm::WindowAnimationsDisabled(content_window_); | 168 !wm::WindowAnimationsDisabled(content_window_); |
168 | 169 |
169 // TODO this is not invoked *after* Init(), but should be ok. | 170 // TODO this is not invoked *after* Init(), but should be ok. |
170 SetWindowTransparency(); | 171 SetWindowTransparency(); |
171 } | 172 } |
172 | 173 |
173 scoped_ptr<corewm::Tooltip> DesktopWindowTreeHostWin::CreateTooltip() { | 174 std::unique_ptr<corewm::Tooltip> DesktopWindowTreeHostWin::CreateTooltip() { |
174 DCHECK(!tooltip_); | 175 DCHECK(!tooltip_); |
175 tooltip_ = new corewm::TooltipWin(GetAcceleratedWidget()); | 176 tooltip_ = new corewm::TooltipWin(GetAcceleratedWidget()); |
176 return make_scoped_ptr(tooltip_); | 177 return base::WrapUnique(tooltip_); |
177 } | 178 } |
178 | 179 |
179 scoped_ptr<aura::client::DragDropClient> | 180 std::unique_ptr<aura::client::DragDropClient> |
180 DesktopWindowTreeHostWin::CreateDragDropClient( | 181 DesktopWindowTreeHostWin::CreateDragDropClient( |
181 DesktopNativeCursorManager* cursor_manager) { | 182 DesktopNativeCursorManager* cursor_manager) { |
182 drag_drop_client_ = new DesktopDragDropClientWin(window(), GetHWND()); | 183 drag_drop_client_ = new DesktopDragDropClientWin(window(), GetHWND()); |
183 return make_scoped_ptr(drag_drop_client_); | 184 return base::WrapUnique(drag_drop_client_); |
184 } | 185 } |
185 | 186 |
186 void DesktopWindowTreeHostWin::Close() { | 187 void DesktopWindowTreeHostWin::Close() { |
187 // TODO(beng): Move this entire branch to DNWA so it can be shared with X11. | 188 // TODO(beng): Move this entire branch to DNWA so it can be shared with X11. |
188 if (should_animate_window_close_) { | 189 if (should_animate_window_close_) { |
189 pending_close_ = true; | 190 pending_close_ = true; |
190 const bool is_animating = | 191 const bool is_animating = |
191 content_window_->layer()->GetAnimator()->IsAnimatingProperty( | 192 content_window_->layer()->GetAnimator()->IsAnimatingProperty( |
192 ui::LayerAnimationElement::VISIBILITY); | 193 ui::LayerAnimationElement::VISIBILITY); |
193 // Animation may not start for a number of reasons. | 194 // Animation may not start for a number of reasons. |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 | 969 |
969 // static | 970 // static |
970 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 971 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
971 internal::NativeWidgetDelegate* native_widget_delegate, | 972 internal::NativeWidgetDelegate* native_widget_delegate, |
972 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 973 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
973 return new DesktopWindowTreeHostWin(native_widget_delegate, | 974 return new DesktopWindowTreeHostWin(native_widget_delegate, |
974 desktop_native_widget_aura); | 975 desktop_native_widget_aura); |
975 } | 976 } |
976 | 977 |
977 } // namespace views | 978 } // namespace views |
OLD | NEW |