| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mus/desktop_window_tree_host_mus.h" | 5 #include "ui/views/mus/desktop_window_tree_host_mus.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // renders to. | 280 // renders to. |
| 281 content_window->layer()->SetFillsBoundsOpaquely(false); | 281 content_window->layer()->SetFillsBoundsOpaquely(false); |
| 282 if (!params.bounds.IsEmpty()) | 282 if (!params.bounds.IsEmpty()) |
| 283 SetBoundsInDIP(params.bounds); | 283 SetBoundsInDIP(params.bounds); |
| 284 | 284 |
| 285 cursor_manager_ = base::MakeUnique<wm::CursorManager>( | 285 cursor_manager_ = base::MakeUnique<wm::CursorManager>( |
| 286 base::MakeUnique<NativeCursorManagerMus>(window())); | 286 base::MakeUnique<NativeCursorManagerMus>(window())); |
| 287 aura::client::SetCursorClient(window(), cursor_manager_.get()); | 287 aura::client::SetCursorClient(window(), cursor_manager_.get()); |
| 288 InitHost(); | 288 InitHost(); |
| 289 | 289 |
| 290 NativeWidgetAura::SetShadowElevationFromInitParams(window(), params); |
| 291 |
| 290 // Transient parents are connected using the Window created by WindowTreeHost, | 292 // Transient parents are connected using the Window created by WindowTreeHost, |
| 291 // which is owned by the window manager. This way the window manager can | 293 // which is owned by the window manager. This way the window manager can |
| 292 // properly identify and honor transients. | 294 // properly identify and honor transients. |
| 293 if (params.parent && params.parent->GetHost()) { | 295 if (params.parent && params.parent->GetHost()) { |
| 294 aura::client::GetTransientWindowClient()->AddTransientChild( | 296 aura::client::GetTransientWindowClient()->AddTransientChild( |
| 295 params.parent->GetHost()->window(), window()); | 297 params.parent->GetHost()->window(), window()); |
| 296 } | 298 } |
| 297 | 299 |
| 298 if (!params.accept_events) { | 300 if (!params.accept_events) { |
| 299 aura::WindowPortMus::Get(window())->SetEventTargetingPolicy( | 301 aura::WindowPortMus::Get(window())->SetEventTargetingPolicy( |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 bool DesktopWindowTreeHostMus::ShouldUpdateWindowTransparency() const { | 712 bool DesktopWindowTreeHostMus::ShouldUpdateWindowTransparency() const { |
| 711 // Needed so the window manager can render the client decorations. | 713 // Needed so the window manager can render the client decorations. |
| 712 return false; | 714 return false; |
| 713 } | 715 } |
| 714 | 716 |
| 715 bool DesktopWindowTreeHostMus::ShouldUseDesktopNativeCursorManager() const { | 717 bool DesktopWindowTreeHostMus::ShouldUseDesktopNativeCursorManager() const { |
| 716 // We manage the cursor ourself. | 718 // We manage the cursor ourself. |
| 717 return false; | 719 return false; |
| 718 } | 720 } |
| 719 | 721 |
| 722 bool DesktopWindowTreeHostMus::ShouldCreateVisibilityController() const { |
| 723 // Window manager takes care of all top-level window animations. |
| 724 return false; |
| 725 } |
| 726 |
| 720 void DesktopWindowTreeHostMus::OnWindowManagerFrameValuesChanged() { | 727 void DesktopWindowTreeHostMus::OnWindowManagerFrameValuesChanged() { |
| 721 NonClientView* non_client_view = | 728 NonClientView* non_client_view = |
| 722 native_widget_delegate_->AsWidget()->non_client_view(); | 729 native_widget_delegate_->AsWidget()->non_client_view(); |
| 723 if (non_client_view) { | 730 if (non_client_view) { |
| 724 non_client_view->Layout(); | 731 non_client_view->Layout(); |
| 725 non_client_view->SchedulePaint(); | 732 non_client_view->SchedulePaint(); |
| 726 } | 733 } |
| 727 | 734 |
| 728 SendClientAreaToServer(); | 735 SendClientAreaToServer(); |
| 729 SendHitTestMaskToServer(); | 736 SendHitTestMaskToServer(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 aura::client::FocusClient* focus_client, | 803 aura::client::FocusClient* focus_client, |
| 797 aura::Window* window) { | 804 aura::Window* window) { |
| 798 if (window == this->window()) { | 805 if (window == this->window()) { |
| 799 desktop_native_widget_aura_->HandleActivationChanged(true); | 806 desktop_native_widget_aura_->HandleActivationChanged(true); |
| 800 } else if (is_active_) { | 807 } else if (is_active_) { |
| 801 desktop_native_widget_aura_->HandleActivationChanged(false); | 808 desktop_native_widget_aura_->HandleActivationChanged(false); |
| 802 } | 809 } |
| 803 } | 810 } |
| 804 | 811 |
| 805 } // namespace views | 812 } // namespace views |
| OLD | NEW |