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

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

Issue 2023933002: views/mus: Recreate WindowManagerConnection for each test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 4 years, 6 months 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 | « ui/views/mus/views_mus_test_suite.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/window_manager_connection.h" 5 #include "ui/views/mus/window_manager_connection.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 base::Unretained(this), 122 base::Unretained(this),
123 std::map<std::string, std::vector<uint8_t>>())); 123 std::map<std::string, std::vector<uint8_t>>()));
124 } 124 }
125 125
126 WindowManagerConnection::~WindowManagerConnection() { 126 WindowManagerConnection::~WindowManagerConnection() {
127 // ~WindowTreeClient calls back to us (we're its delegate), destroy it while 127 // ~WindowTreeClient calls back to us (we're its delegate), destroy it while
128 // we are still valid. 128 // we are still valid.
129 client_.reset(); 129 client_.reset();
130 if (created_device_data_manager_) 130 if (created_device_data_manager_)
131 ui::DeviceDataManager::DeleteInstance(); 131 ui::DeviceDataManager::DeleteInstance();
132
133 if (ViewsDelegate::GetInstance()) {
134 ViewsDelegate::GetInstance()->set_native_widget_factory(
135 ViewsDelegate::NativeWidgetFactory());
136 }
132 } 137 }
133 138
134 bool WindowManagerConnection::HasPointerWatcher() { 139 bool WindowManagerConnection::HasPointerWatcher() {
135 // Check to see if we really have any observers left. This doesn't use 140 // Check to see if we really have any observers left. This doesn't use
136 // base::ObserverList<>::might_have_observers() because that returns true 141 // base::ObserverList<>::might_have_observers() because that returns true
137 // during iteration over the list even when the last observer is removed. 142 // during iteration over the list even when the last observer is removed.
138 base::ObserverList<PointerWatcher>::Iterator iterator(&pointer_watchers_); 143 base::ObserverList<PointerWatcher>::Iterator iterator(&pointer_watchers_);
139 return !!iterator.GetNext(); 144 return !!iterator.GetNext();
140 } 145 }
141 146
(...skipping 30 matching lines...) Expand all
172 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { 177 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() {
173 if (client_) 178 if (client_)
174 NativeWidgetMus::NotifyFrameChanged(client_.get()); 179 NativeWidgetMus::NotifyFrameChanged(client_.get());
175 } 180 }
176 181
177 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { 182 gfx::Point WindowManagerConnection::GetCursorScreenPoint() {
178 return client_->GetCursorScreenPoint(); 183 return client_->GetCursorScreenPoint();
179 } 184 }
180 185
181 } // namespace views 186 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/views_mus_test_suite.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698