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/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.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/ime/null_input_method.h" | 30 #include "ui/views/ime/null_input_method.h" |
31 #include "ui/views/views_delegate.h" | 31 #include "ui/views/views_delegate.h" |
32 #include "ui/views/widget/drop_helper.h" | 32 #include "ui/views/widget/drop_helper.h" |
33 #include "ui/views/widget/native_widget_delegate.h" | 33 #include "ui/views/widget/native_widget_delegate.h" |
34 #include "ui/views/widget/root_view.h" | 34 #include "ui/views/widget/root_view.h" |
35 #include "ui/views/widget/tooltip_manager_aura.h" | 35 #include "ui/views/widget/tooltip_manager_aura.h" |
36 #include "ui/views/widget/widget_aura_utils.h" | 36 #include "ui/views/widget/widget_aura_utils.h" |
37 #include "ui/views/widget/widget_delegate.h" | 37 #include "ui/views/widget/widget_delegate.h" |
38 #include "ui/views/widget/window_reorderer.h" | 38 #include "ui/views/widget/window_reorderer.h" |
39 #include "ui/wm/core/shadow_types.h" | 39 #include "ui/wm/core/shadow_types.h" |
| 40 #include "ui/wm/core/window_animations.h" |
40 #include "ui/wm/core/window_util.h" | 41 #include "ui/wm/core/window_util.h" |
41 #include "ui/wm/public/activation_client.h" | 42 #include "ui/wm/public/activation_client.h" |
42 #include "ui/wm/public/drag_drop_client.h" | 43 #include "ui/wm/public/drag_drop_client.h" |
43 #include "ui/wm/public/window_move_client.h" | 44 #include "ui/wm/public/window_move_client.h" |
44 #include "ui/wm/public/window_types.h" | 45 #include "ui/wm/public/window_types.h" |
45 | 46 |
46 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
47 #include "base/win/scoped_gdi_object.h" | 48 #include "base/win/scoped_gdi_object.h" |
48 #include "base/win/win_util.h" | 49 #include "base/win/win_util.h" |
49 #include "ui/base/l10n/l10n_util_win.h" | 50 #include "ui/base/l10n/l10n_util_win.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 aura::client::GetWindowMoveClient(window_->GetRootWindow()); | 672 aura::client::GetWindowMoveClient(window_->GetRootWindow()); |
672 if (move_client) | 673 if (move_client) |
673 move_client->EndMoveLoop(); | 674 move_client->EndMoveLoop(); |
674 } | 675 } |
675 | 676 |
676 void NativeWidgetAura::SetVisibilityChangedAnimationsEnabled(bool value) { | 677 void NativeWidgetAura::SetVisibilityChangedAnimationsEnabled(bool value) { |
677 if (window_) | 678 if (window_) |
678 window_->SetProperty(aura::client::kAnimationsDisabledKey, !value); | 679 window_->SetProperty(aura::client::kAnimationsDisabledKey, !value); |
679 } | 680 } |
680 | 681 |
| 682 void NativeWidgetAura::SetVisibilityAnimationDuration( |
| 683 const base::TimeDelta& duration) { |
| 684 wm::SetWindowVisibilityAnimationDuration(window_, duration); |
| 685 } |
| 686 |
| 687 void NativeWidgetAura::SetVisibilityAnimationTransition( |
| 688 Widget::VisibilityTransition transition) { |
| 689 wm::WindowVisibilityAnimationTransition wm_transition = wm::ANIMATE_NONE; |
| 690 switch (transition) { |
| 691 case Widget::ANIMATE_SHOW: |
| 692 wm_transition = wm::ANIMATE_SHOW; |
| 693 break; |
| 694 case Widget::ANIMATE_HIDE: |
| 695 wm_transition = wm::ANIMATE_HIDE; |
| 696 break; |
| 697 case Widget::ANIMATE_BOTH: |
| 698 wm_transition = wm::ANIMATE_BOTH; |
| 699 break; |
| 700 case Widget::ANIMATE_NONE: |
| 701 wm_transition = wm::ANIMATE_NONE; |
| 702 break; |
| 703 } |
| 704 wm::SetWindowVisibilityAnimationTransition(window_, wm_transition); |
| 705 } |
| 706 |
681 ui::NativeTheme* NativeWidgetAura::GetNativeTheme() const { | 707 ui::NativeTheme* NativeWidgetAura::GetNativeTheme() const { |
682 #if !defined(OS_CHROMEOS) | 708 #if !defined(OS_CHROMEOS) |
683 return DesktopWindowTreeHost::GetNativeTheme(window_); | 709 return DesktopWindowTreeHost::GetNativeTheme(window_); |
684 #else | 710 #else |
685 return ui::NativeThemeAura::instance(); | 711 return ui::NativeThemeAura::instance(); |
686 #endif | 712 #endif |
687 } | 713 } |
688 | 714 |
689 void NativeWidgetAura::OnRootViewLayout() { | 715 void NativeWidgetAura::OnRootViewLayout() { |
690 } | 716 } |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1201 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
1176 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1202 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
1177 return gfx::FontList(gfx::Font(caption_font)); | 1203 return gfx::FontList(gfx::Font(caption_font)); |
1178 #else | 1204 #else |
1179 return gfx::FontList(); | 1205 return gfx::FontList(); |
1180 #endif | 1206 #endif |
1181 } | 1207 } |
1182 | 1208 |
1183 } // namespace internal | 1209 } // namespace internal |
1184 } // namespace views | 1210 } // namespace views |
OLD | NEW |