Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2596723002: mus: Unset the cursor client during teardown. (Closed)
Patch Set: - Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/mus/desktop_window_tree_host_mus_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // DesktopNativeWidgetAura registers the association between |content_window_| 183 // DesktopNativeWidgetAura registers the association between |content_window_|
184 // and Widget, but code may also want to go from the root (window()) to the 184 // and Widget, but code may also want to go from the root (window()) to the
185 // Widget. This call enables that. 185 // Widget. This call enables that.
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 // The cursor-client can be accessed during WindowTreeHostMus tear-down. So
194 // the cursor-client needs to be unset on the root-window before
195 // |cursor_manager_| is destroyed.
196 aura::client::SetCursorClient(window(), nullptr);
193 MusClient::Get()->RemoveObserver(this); 197 MusClient::Get()->RemoveObserver(this);
194 aura::Env::GetInstance()->RemoveObserver(this); 198 aura::Env::GetInstance()->RemoveObserver(this);
195 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this); 199 desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this);
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
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | ui/views/mus/desktop_window_tree_host_mus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698