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 "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" | 39 #include "ui/views/widget/desktop_aura/desktop_screen_position_client.h" |
40 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" | 40 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" |
41 #include "ui/views/widget/drop_helper.h" | 41 #include "ui/views/widget/drop_helper.h" |
42 #include "ui/views/widget/native_widget_aura.h" | 42 #include "ui/views/widget/native_widget_aura.h" |
43 #include "ui/views/widget/root_view.h" | 43 #include "ui/views/widget/root_view.h" |
44 #include "ui/views/widget/tooltip_manager_aura.h" | 44 #include "ui/views/widget/tooltip_manager_aura.h" |
45 #include "ui/views/widget/widget.h" | 45 #include "ui/views/widget/widget.h" |
46 #include "ui/views/widget/widget_aura_utils.h" | 46 #include "ui/views/widget/widget_aura_utils.h" |
47 #include "ui/views/widget/widget_delegate.h" | 47 #include "ui/views/widget/widget_delegate.h" |
48 #include "ui/views/widget/window_reorderer.h" | 48 #include "ui/views/widget/window_reorderer.h" |
| 49 #include "ui/views/widget/window_visibility_animation_aura.h" |
49 #include "ui/views/window/native_frame_view.h" | 50 #include "ui/views/window/native_frame_view.h" |
50 #include "ui/wm/core/compound_event_filter.h" | 51 #include "ui/wm/core/compound_event_filter.h" |
51 #include "ui/wm/core/cursor_manager.h" | 52 #include "ui/wm/core/cursor_manager.h" |
52 #include "ui/wm/core/focus_controller.h" | 53 #include "ui/wm/core/focus_controller.h" |
53 #include "ui/wm/core/input_method_event_filter.h" | 54 #include "ui/wm/core/input_method_event_filter.h" |
54 #include "ui/wm/core/native_cursor_manager.h" | 55 #include "ui/wm/core/native_cursor_manager.h" |
55 #include "ui/wm/core/shadow_controller.h" | 56 #include "ui/wm/core/shadow_controller.h" |
56 #include "ui/wm/core/shadow_types.h" | 57 #include "ui/wm/core/shadow_types.h" |
57 #include "ui/wm/core/visibility_controller.h" | 58 #include "ui/wm/core/visibility_controller.h" |
58 #include "ui/wm/core/window_modality_controller.h" | 59 #include "ui/wm/core/window_modality_controller.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 internal::NativeWidgetDelegate* delegate) | 254 internal::NativeWidgetDelegate* delegate) |
254 : desktop_window_tree_host_(NULL), | 255 : desktop_window_tree_host_(NULL), |
255 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET), | 256 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET), |
256 content_window_container_(NULL), | 257 content_window_container_(NULL), |
257 content_window_(new aura::Window(this)), | 258 content_window_(new aura::Window(this)), |
258 native_widget_delegate_(delegate), | 259 native_widget_delegate_(delegate), |
259 last_drop_operation_(ui::DragDropTypes::DRAG_NONE), | 260 last_drop_operation_(ui::DragDropTypes::DRAG_NONE), |
260 restore_focus_on_activate_(false), | 261 restore_focus_on_activate_(false), |
261 cursor_(gfx::kNullCursor), | 262 cursor_(gfx::kNullCursor), |
262 widget_type_(Widget::InitParams::TYPE_WINDOW), | 263 widget_type_(Widget::InitParams::TYPE_WINDOW), |
| 264 visibility_animation_(new WindowVisibilityAnimationAura(content_window_)), |
263 close_widget_factory_(this) { | 265 close_widget_factory_(this) { |
264 aura::client::SetFocusChangeObserver(content_window_, this); | 266 aura::client::SetFocusChangeObserver(content_window_, this); |
265 aura::client::SetActivationChangeObserver(content_window_, this); | 267 aura::client::SetActivationChangeObserver(content_window_, this); |
266 } | 268 } |
267 | 269 |
268 DesktopNativeWidgetAura::~DesktopNativeWidgetAura() { | 270 DesktopNativeWidgetAura::~DesktopNativeWidgetAura() { |
269 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) | 271 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) |
270 delete native_widget_delegate_; | 272 delete native_widget_delegate_; |
271 else | 273 else |
272 CloseNow(); | 274 CloseNow(); |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 if (content_window_) | 909 if (content_window_) |
908 desktop_window_tree_host_->EndMoveLoop(); | 910 desktop_window_tree_host_->EndMoveLoop(); |
909 } | 911 } |
910 | 912 |
911 void DesktopNativeWidgetAura::SetVisibilityChangedAnimationsEnabled( | 913 void DesktopNativeWidgetAura::SetVisibilityChangedAnimationsEnabled( |
912 bool value) { | 914 bool value) { |
913 if (content_window_) | 915 if (content_window_) |
914 desktop_window_tree_host_->SetVisibilityChangedAnimationsEnabled(value); | 916 desktop_window_tree_host_->SetVisibilityChangedAnimationsEnabled(value); |
915 } | 917 } |
916 | 918 |
| 919 Widget::VisibilityAnimation* DesktopNativeWidgetAura::GetVisibilityAnimation() |
| 920 const { |
| 921 return visibility_animation_.get(); |
| 922 } |
| 923 |
917 ui::NativeTheme* DesktopNativeWidgetAura::GetNativeTheme() const { | 924 ui::NativeTheme* DesktopNativeWidgetAura::GetNativeTheme() const { |
918 return DesktopWindowTreeHost::GetNativeTheme(content_window_); | 925 return DesktopWindowTreeHost::GetNativeTheme(content_window_); |
919 } | 926 } |
920 | 927 |
921 void DesktopNativeWidgetAura::OnRootViewLayout() { | 928 void DesktopNativeWidgetAura::OnRootViewLayout() { |
922 if (content_window_) | 929 if (content_window_) |
923 desktop_window_tree_host_->OnRootViewLayout(); | 930 desktop_window_tree_host_->OnRootViewLayout(); |
924 } | 931 } |
925 | 932 |
926 bool DesktopNativeWidgetAura::IsTranslucentWindowOpacitySupported() const { | 933 bool DesktopNativeWidgetAura::IsTranslucentWindowOpacitySupported() const { |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 if (cursor_reference_count_ == 0) { | 1213 if (cursor_reference_count_ == 0) { |
1207 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1214 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
1208 // for cleaning up |cursor_manager_|. | 1215 // for cleaning up |cursor_manager_|. |
1209 delete cursor_manager_; | 1216 delete cursor_manager_; |
1210 native_cursor_manager_ = NULL; | 1217 native_cursor_manager_ = NULL; |
1211 cursor_manager_ = NULL; | 1218 cursor_manager_ = NULL; |
1212 } | 1219 } |
1213 } | 1220 } |
1214 | 1221 |
1215 } // namespace views | 1222 } // namespace views |
OLD | NEW |