| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
| 11 #include "ui/aura/client/aura_constants.h" | 12 #include "ui/aura/client/aura_constants.h" |
| 12 #include "ui/aura/client/cursor_client.h" | 13 #include "ui/aura/client/cursor_client.h" |
| 13 #include "ui/aura/client/drag_drop_client.h" | 14 #include "ui/aura/client/drag_drop_client.h" |
| 14 #include "ui/aura/client/focus_client.h" | 15 #include "ui/aura/client/focus_client.h" |
| 15 #include "ui/aura/client/window_parenting_client.h" | 16 #include "ui/aura/client/window_parenting_client.h" |
| 16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_observer.h" | 18 #include "ui/aura/window_observer.h" |
| 18 #include "ui/aura/window_property.h" | 19 #include "ui/aura/window_property.h" |
| 19 #include "ui/aura/window_tree_host.h" | 20 #include "ui/aura/window_tree_host.h" |
| 20 #include "ui/base/hit_test.h" | 21 #include "ui/base/hit_test.h" |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 ui::NativeTheme* DesktopNativeWidgetAura::GetNativeTheme() const { | 937 ui::NativeTheme* DesktopNativeWidgetAura::GetNativeTheme() const { |
| 937 return DesktopWindowTreeHost::GetNativeTheme(content_window_); | 938 return DesktopWindowTreeHost::GetNativeTheme(content_window_); |
| 938 } | 939 } |
| 939 | 940 |
| 940 bool DesktopNativeWidgetAura::IsTranslucentWindowOpacitySupported() const { | 941 bool DesktopNativeWidgetAura::IsTranslucentWindowOpacitySupported() const { |
| 941 return content_window_ && | 942 return content_window_ && |
| 942 desktop_window_tree_host_->IsTranslucentWindowOpacitySupported(); | 943 desktop_window_tree_host_->IsTranslucentWindowOpacitySupported(); |
| 943 } | 944 } |
| 944 | 945 |
| 945 void DesktopNativeWidgetAura::OnSizeConstraintsChanged() { | 946 void DesktopNativeWidgetAura::OnSizeConstraintsChanged() { |
| 946 content_window_->SetProperty(aura::client::kCanMaximizeKey, | 947 int32_t behavior = ui::mojom::kResizeBehaviorNone; |
| 947 GetWidget()->widget_delegate()->CanMaximize()); | 948 if (GetWidget()->widget_delegate()) |
| 948 content_window_->SetProperty(aura::client::kCanMinimizeKey, | 949 behavior = GetWidget()->widget_delegate()->GetResizeBehavior(); |
| 949 GetWidget()->widget_delegate()->CanMinimize()); | 950 content_window_->SetProperty(aura::client::kResizeBehaviorKey, behavior); |
| 950 content_window_->SetProperty(aura::client::kCanResizeKey, | |
| 951 GetWidget()->widget_delegate()->CanResize()); | |
| 952 desktop_window_tree_host_->SizeConstraintsChanged(); | 951 desktop_window_tree_host_->SizeConstraintsChanged(); |
| 953 } | 952 } |
| 954 | 953 |
| 955 void DesktopNativeWidgetAura::RepostNativeEvent(gfx::NativeEvent native_event) { | 954 void DesktopNativeWidgetAura::RepostNativeEvent(gfx::NativeEvent native_event) { |
| 956 OnEvent(native_event); | 955 OnEvent(native_event); |
| 957 } | 956 } |
| 958 | 957 |
| 959 std::string DesktopNativeWidgetAura::GetName() const { | 958 std::string DesktopNativeWidgetAura::GetName() const { |
| 960 return name_; | 959 return name_; |
| 961 } | 960 } |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 if (cursor_reference_count_ == 0) { | 1197 if (cursor_reference_count_ == 0) { |
| 1199 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1198 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
| 1200 // for cleaning up |cursor_manager_|. | 1199 // for cleaning up |cursor_manager_|. |
| 1201 delete cursor_manager_; | 1200 delete cursor_manager_; |
| 1202 native_cursor_manager_ = NULL; | 1201 native_cursor_manager_ = NULL; |
| 1203 cursor_manager_ = NULL; | 1202 cursor_manager_ = NULL; |
| 1204 } | 1203 } |
| 1205 } | 1204 } |
| 1206 | 1205 |
| 1207 } // namespace views | 1206 } // namespace views |
| OLD | NEW |