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 "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
9 #include "ui/aura/client/cursor_client.h" | 9 #include "ui/aura/client/cursor_client.h" |
10 #include "ui/aura/client/drag_drop_client.h" | 10 #include "ui/aura/client/drag_drop_client.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 NativeWidgetAura::RegisterNativeWidgetForWindow(desktop_native_widget_aura, | 186 NativeWidgetAura::RegisterNativeWidgetForWindow(desktop_native_widget_aura, |
187 window()); | 187 window()); |
188 // TODO: use display id and bounds if available, likely need to pass in | 188 // TODO: use display id and bounds if available, likely need to pass in |
189 // InitParams for that. | 189 // InitParams for that. |
190 } | 190 } |
191 | 191 |
192 DesktopWindowTreeHostMus::~DesktopWindowTreeHostMus() { | 192 DesktopWindowTreeHostMus::~DesktopWindowTreeHostMus() { |
193 MusClient::Get()->RemoveObserver(this); | 193 MusClient::Get()->RemoveObserver(this); |
194 aura::Env::GetInstance()->RemoveObserver(this); | 194 aura::Env::GetInstance()->RemoveObserver(this); |
195 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this); | 195 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this); |
196 // The cursor-client can be accessed during WindowTreeHostMus tear-down. So | |
197 // the cursor client needs to be unset on the root-window before | |
198 // |cursor_manager_| is destroyed. | |
199 aura::client::SetCursorClient(window(), nullptr); | |
James Cook
2016/12/21 04:02:31
nit: Should this be done before line 193 so that t
sadrul
2016/12/21 17:45:57
Done.
| |
196 } | 200 } |
197 | 201 |
198 bool DesktopWindowTreeHostMus::IsDocked() const { | 202 bool DesktopWindowTreeHostMus::IsDocked() const { |
199 return window()->GetProperty(aura::client::kShowStateKey) == | 203 return window()->GetProperty(aura::client::kShowStateKey) == |
200 ui::SHOW_STATE_DOCKED; | 204 ui::SHOW_STATE_DOCKED; |
201 } | 205 } |
202 | 206 |
203 void DesktopWindowTreeHostMus::SendClientAreaToServer() { | 207 void DesktopWindowTreeHostMus::SendClientAreaToServer() { |
204 if (!ShouldSendClientAreaToServer()) | 208 if (!ShouldSendClientAreaToServer()) |
205 return; | 209 return; |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
708 if (window == this->window()) { | 712 if (window == this->window()) { |
709 is_active_ = true; | 713 is_active_ = true; |
710 desktop_native_widget_aura_->HandleActivationChanged(true); | 714 desktop_native_widget_aura_->HandleActivationChanged(true); |
711 } else if (is_active_) { | 715 } else if (is_active_) { |
712 is_active_ = false; | 716 is_active_ = false; |
713 desktop_native_widget_aura_->HandleActivationChanged(false); | 717 desktop_native_widget_aura_->HandleActivationChanged(false); |
714 } | 718 } |
715 } | 719 } |
716 | 720 |
717 } // namespace views | 721 } // namespace views |
OLD | NEW |