| 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 18 matching lines...) Expand all Loading... |
| 29 #include "ui/views/ime/input_method_bridge.h" | 29 #include "ui/views/ime/input_method_bridge.h" |
| 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/views/widget/window_visibility_animation_aura.h" |
| 39 #include "ui/wm/core/shadow_types.h" | 40 #include "ui/wm/core/shadow_types.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" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 72 //////////////////////////////////////////////////////////////////////////////// | 73 //////////////////////////////////////////////////////////////////////////////// |
| 73 // NativeWidgetAura, public: | 74 // NativeWidgetAura, public: |
| 74 | 75 |
| 75 NativeWidgetAura::NativeWidgetAura(internal::NativeWidgetDelegate* delegate) | 76 NativeWidgetAura::NativeWidgetAura(internal::NativeWidgetDelegate* delegate) |
| 76 : delegate_(delegate), | 77 : delegate_(delegate), |
| 77 window_(new aura::Window(this)), | 78 window_(new aura::Window(this)), |
| 78 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET), | 79 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET), |
| 79 destroying_(false), | 80 destroying_(false), |
| 80 cursor_(gfx::kNullCursor), | 81 cursor_(gfx::kNullCursor), |
| 81 saved_window_state_(ui::SHOW_STATE_DEFAULT), | 82 saved_window_state_(ui::SHOW_STATE_DEFAULT), |
| 83 visibility_animation_(new WindowVisibilityAnimationAura(window_)), |
| 82 close_widget_factory_(this) { | 84 close_widget_factory_(this) { |
| 83 aura::client::SetFocusChangeObserver(window_, this); | 85 aura::client::SetFocusChangeObserver(window_, this); |
| 84 aura::client::SetActivationChangeObserver(window_, this); | 86 aura::client::SetActivationChangeObserver(window_, this); |
| 85 } | 87 } |
| 86 | 88 |
| 87 // static | 89 // static |
| 88 void NativeWidgetAura::RegisterNativeWidgetForWindow( | 90 void NativeWidgetAura::RegisterNativeWidgetForWindow( |
| 89 internal::NativeWidgetPrivate* native_widget, | 91 internal::NativeWidgetPrivate* native_widget, |
| 90 aura::Window* window) { | 92 aura::Window* window) { |
| 91 window->set_user_data(native_widget); | 93 window->set_user_data(native_widget); |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 aura::client::GetWindowMoveClient(window_->GetRootWindow()); | 673 aura::client::GetWindowMoveClient(window_->GetRootWindow()); |
| 672 if (move_client) | 674 if (move_client) |
| 673 move_client->EndMoveLoop(); | 675 move_client->EndMoveLoop(); |
| 674 } | 676 } |
| 675 | 677 |
| 676 void NativeWidgetAura::SetVisibilityChangedAnimationsEnabled(bool value) { | 678 void NativeWidgetAura::SetVisibilityChangedAnimationsEnabled(bool value) { |
| 677 if (window_) | 679 if (window_) |
| 678 window_->SetProperty(aura::client::kAnimationsDisabledKey, !value); | 680 window_->SetProperty(aura::client::kAnimationsDisabledKey, !value); |
| 679 } | 681 } |
| 680 | 682 |
| 683 Widget::VisibilityAnimation* NativeWidgetAura::GetVisibilityAnimation() const { |
| 684 return visibility_animation_.get(); |
| 685 } |
| 686 |
| 681 ui::NativeTheme* NativeWidgetAura::GetNativeTheme() const { | 687 ui::NativeTheme* NativeWidgetAura::GetNativeTheme() const { |
| 682 #if !defined(OS_CHROMEOS) | 688 #if !defined(OS_CHROMEOS) |
| 683 return DesktopWindowTreeHost::GetNativeTheme(window_); | 689 return DesktopWindowTreeHost::GetNativeTheme(window_); |
| 684 #else | 690 #else |
| 685 return ui::NativeThemeAura::instance(); | 691 return ui::NativeThemeAura::instance(); |
| 686 #endif | 692 #endif |
| 687 } | 693 } |
| 688 | 694 |
| 689 void NativeWidgetAura::OnRootViewLayout() { | 695 void NativeWidgetAura::OnRootViewLayout() { |
| 690 } | 696 } |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1181 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
| 1176 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1182 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
| 1177 return gfx::FontList(gfx::Font(caption_font)); | 1183 return gfx::FontList(gfx::Font(caption_font)); |
| 1178 #else | 1184 #else |
| 1179 return gfx::FontList(); | 1185 return gfx::FontList(); |
| 1180 #endif | 1186 #endif |
| 1181 } | 1187 } |
| 1182 | 1188 |
| 1183 } // namespace internal | 1189 } // namespace internal |
| 1184 } // namespace views | 1190 } // namespace views |
| OLD | NEW |