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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "ui/views/widget/window_reorderer.h" | 48 #include "ui/views/widget/window_reorderer.h" |
49 #include "ui/views/window/native_frame_view.h" | 49 #include "ui/views/window/native_frame_view.h" |
50 #include "ui/wm/core/compound_event_filter.h" | 50 #include "ui/wm/core/compound_event_filter.h" |
51 #include "ui/wm/core/cursor_manager.h" | 51 #include "ui/wm/core/cursor_manager.h" |
52 #include "ui/wm/core/focus_controller.h" | 52 #include "ui/wm/core/focus_controller.h" |
53 #include "ui/wm/core/input_method_event_filter.h" | 53 #include "ui/wm/core/input_method_event_filter.h" |
54 #include "ui/wm/core/native_cursor_manager.h" | 54 #include "ui/wm/core/native_cursor_manager.h" |
55 #include "ui/wm/core/shadow_controller.h" | 55 #include "ui/wm/core/shadow_controller.h" |
56 #include "ui/wm/core/shadow_types.h" | 56 #include "ui/wm/core/shadow_types.h" |
57 #include "ui/wm/core/visibility_controller.h" | 57 #include "ui/wm/core/visibility_controller.h" |
| 58 #include "ui/wm/core/window_animations.h" |
58 #include "ui/wm/core/window_modality_controller.h" | 59 #include "ui/wm/core/window_modality_controller.h" |
59 #include "ui/wm/public/activation_client.h" | 60 #include "ui/wm/public/activation_client.h" |
60 #include "ui/wm/public/drag_drop_client.h" | 61 #include "ui/wm/public/drag_drop_client.h" |
61 | 62 |
62 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
63 #include "ui/base/win/shell.h" | 64 #include "ui/base/win/shell.h" |
64 #include "ui/gfx/win/dpi.h" | 65 #include "ui/gfx/win/dpi.h" |
65 #endif | 66 #endif |
66 | 67 |
67 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(VIEWS_EXPORT, | 68 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(VIEWS_EXPORT, |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 if (content_window_) | 908 if (content_window_) |
908 desktop_window_tree_host_->EndMoveLoop(); | 909 desktop_window_tree_host_->EndMoveLoop(); |
909 } | 910 } |
910 | 911 |
911 void DesktopNativeWidgetAura::SetVisibilityChangedAnimationsEnabled( | 912 void DesktopNativeWidgetAura::SetVisibilityChangedAnimationsEnabled( |
912 bool value) { | 913 bool value) { |
913 if (content_window_) | 914 if (content_window_) |
914 desktop_window_tree_host_->SetVisibilityChangedAnimationsEnabled(value); | 915 desktop_window_tree_host_->SetVisibilityChangedAnimationsEnabled(value); |
915 } | 916 } |
916 | 917 |
| 918 void DesktopNativeWidgetAura::SetVisibilityAnimationDuration( |
| 919 const base::TimeDelta& duration) { |
| 920 wm::SetWindowVisibilityAnimationDuration(content_window_, duration); |
| 921 } |
| 922 |
| 923 void DesktopNativeWidgetAura::SetVisibilityAnimationTransition( |
| 924 Widget::VisibilityTransition transition) { |
| 925 wm::WindowVisibilityAnimationTransition wm_transition = wm::ANIMATE_NONE; |
| 926 switch (transition) { |
| 927 case Widget::ANIMATE_SHOW: |
| 928 wm_transition = wm::ANIMATE_SHOW; |
| 929 break; |
| 930 case Widget::ANIMATE_HIDE: |
| 931 wm_transition = wm::ANIMATE_HIDE; |
| 932 break; |
| 933 case Widget::ANIMATE_BOTH: |
| 934 wm_transition = wm::ANIMATE_BOTH; |
| 935 break; |
| 936 case Widget::ANIMATE_NONE: |
| 937 wm_transition = wm::ANIMATE_NONE; |
| 938 break; |
| 939 } |
| 940 wm::SetWindowVisibilityAnimationTransition(content_window_, wm_transition); |
| 941 } |
| 942 |
917 ui::NativeTheme* DesktopNativeWidgetAura::GetNativeTheme() const { | 943 ui::NativeTheme* DesktopNativeWidgetAura::GetNativeTheme() const { |
918 return DesktopWindowTreeHost::GetNativeTheme(content_window_); | 944 return DesktopWindowTreeHost::GetNativeTheme(content_window_); |
919 } | 945 } |
920 | 946 |
921 void DesktopNativeWidgetAura::OnRootViewLayout() { | 947 void DesktopNativeWidgetAura::OnRootViewLayout() { |
922 if (content_window_) | 948 if (content_window_) |
923 desktop_window_tree_host_->OnRootViewLayout(); | 949 desktop_window_tree_host_->OnRootViewLayout(); |
924 } | 950 } |
925 | 951 |
926 bool DesktopNativeWidgetAura::IsTranslucentWindowOpacitySupported() const { | 952 bool DesktopNativeWidgetAura::IsTranslucentWindowOpacitySupported() const { |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 if (cursor_reference_count_ == 0) { | 1232 if (cursor_reference_count_ == 0) { |
1207 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1233 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
1208 // for cleaning up |cursor_manager_|. | 1234 // for cleaning up |cursor_manager_|. |
1209 delete cursor_manager_; | 1235 delete cursor_manager_; |
1210 native_cursor_manager_ = NULL; | 1236 native_cursor_manager_ = NULL; |
1211 cursor_manager_ = NULL; | 1237 cursor_manager_ = NULL; |
1212 } | 1238 } |
1213 } | 1239 } |
1214 | 1240 |
1215 } // namespace views | 1241 } // namespace views |
OLD | NEW |