Chromium Code Reviews| 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/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 native_widget_delegate_(native_widget_delegate), | 178 native_widget_delegate_(native_widget_delegate), |
| 179 desktop_native_widget_aura_(desktop_native_widget_aura), | 179 desktop_native_widget_aura_(desktop_native_widget_aura), |
| 180 fullscreen_restore_state_(ui::SHOW_STATE_DEFAULT), | 180 fullscreen_restore_state_(ui::SHOW_STATE_DEFAULT), |
| 181 close_widget_factory_(this) { | 181 close_widget_factory_(this) { |
| 182 aura::Env::GetInstance()->AddObserver(this); | 182 aura::Env::GetInstance()->AddObserver(this); |
| 183 MusClient::Get()->AddObserver(this); | 183 MusClient::Get()->AddObserver(this); |
| 184 native_widget_delegate_->AsWidget()->AddObserver(this); | 184 native_widget_delegate_->AsWidget()->AddObserver(this); |
| 185 // DesktopNativeWidgetAura registers the association between |content_window_| | 185 // DesktopNativeWidgetAura registers the association between |content_window_| |
| 186 // and Widget, but code may also want to go from the root (window()) to the | 186 // and Widget, but code may also want to go from the root (window()) to the |
| 187 // Widget. This call enables that. | 187 // Widget. This call enables that. |
| 188 NativeWidgetAura::RegisterNativeWidgetForWindow(desktop_native_widget_aura, | 188 NativeWidgetAura::RegisterNativeWidgetForWindow(desktop_native_widget_aura, |
|
tapted
2017/01/25 11:23:03
I tried moving this up to DesktopNativeWidgetAura
sky
2017/01/25 16:41:24
Interesting...
| |
| 189 window()); | 189 window()); |
| 190 // TODO: use display id and bounds if available, likely need to pass in | 190 // TODO: use display id and bounds if available, likely need to pass in |
| 191 // InitParams for that. | 191 // InitParams for that. |
| 192 } | 192 } |
| 193 | 193 |
| 194 DesktopWindowTreeHostMus::~DesktopWindowTreeHostMus() { | 194 DesktopWindowTreeHostMus::~DesktopWindowTreeHostMus() { |
| 195 // The cursor-client can be accessed during WindowTreeHostMus tear-down. So | 195 // The cursor-client can be accessed during WindowTreeHostMus tear-down. So |
| 196 // the cursor-client needs to be unset on the root-window before | 196 // the cursor-client needs to be unset on the root-window before |
| 197 // |cursor_manager_| is destroyed. | 197 // |cursor_manager_| is destroyed. |
| 198 aura::client::SetCursorClient(window(), nullptr); | 198 aura::client::SetCursorClient(window(), nullptr); |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 660 bool DesktopWindowTreeHostMus::ShouldUpdateWindowTransparency() const { | 660 bool DesktopWindowTreeHostMus::ShouldUpdateWindowTransparency() const { |
| 661 // Needed so the window manager can render the client decorations. | 661 // Needed so the window manager can render the client decorations. |
| 662 return false; | 662 return false; |
| 663 } | 663 } |
| 664 | 664 |
| 665 bool DesktopWindowTreeHostMus::ShouldUseDesktopNativeCursorManager() const { | 665 bool DesktopWindowTreeHostMus::ShouldUseDesktopNativeCursorManager() const { |
| 666 // We manage the cursor ourself. | 666 // We manage the cursor ourself. |
| 667 return false; | 667 return false; |
| 668 } | 668 } |
| 669 | 669 |
| 670 std::vector<DesktopWindowTreeHost*> | |
| 671 DesktopWindowTreeHostMus::GetOwnedTopLevelHosts() const { | |
| 672 return std::vector<DesktopWindowTreeHost*>(children_.begin(), | |
| 673 children_.end()); | |
| 674 } | |
| 675 | |
| 670 void DesktopWindowTreeHostMus::OnWindowManagerFrameValuesChanged() { | 676 void DesktopWindowTreeHostMus::OnWindowManagerFrameValuesChanged() { |
| 671 NonClientView* non_client_view = | 677 NonClientView* non_client_view = |
| 672 native_widget_delegate_->AsWidget()->non_client_view(); | 678 native_widget_delegate_->AsWidget()->non_client_view(); |
| 673 if (non_client_view) { | 679 if (non_client_view) { |
| 674 non_client_view->Layout(); | 680 non_client_view->Layout(); |
| 675 non_client_view->SchedulePaint(); | 681 non_client_view->SchedulePaint(); |
| 676 } | 682 } |
| 677 | 683 |
| 678 SendClientAreaToServer(); | 684 SendClientAreaToServer(); |
| 679 SendHitTestMaskToServer(); | 685 SendHitTestMaskToServer(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 730 aura::client::FocusClient* focus_client, | 736 aura::client::FocusClient* focus_client, |
| 731 aura::Window* window) { | 737 aura::Window* window) { |
| 732 if (window == this->window()) { | 738 if (window == this->window()) { |
| 733 desktop_native_widget_aura_->HandleActivationChanged(true); | 739 desktop_native_widget_aura_->HandleActivationChanged(true); |
| 734 } else if (is_active_) { | 740 } else if (is_active_) { |
| 735 desktop_native_widget_aura_->HandleActivationChanged(false); | 741 desktop_native_widget_aura_->HandleActivationChanged(false); |
| 736 } | 742 } |
| 737 } | 743 } |
| 738 | 744 |
| 739 } // namespace views | 745 } // namespace views |
| OLD | NEW |