| OLD | NEW |
| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 | 95 |
| 96 void WindowManagerConnection::RemovePointerWatcher(PointerWatcher* watcher) { | 96 void WindowManagerConnection::RemovePointerWatcher(PointerWatcher* watcher) { |
| 97 pointer_watchers_.RemoveObserver(watcher); | 97 pointer_watchers_.RemoveObserver(watcher); |
| 98 if (!HasPointerWatcher()) { | 98 if (!HasPointerWatcher()) { |
| 99 // Last PointerWatcher removed, stop the event observer. | 99 // Last PointerWatcher removed, stop the event observer. |
| 100 client_->SetEventObserver(nullptr); | 100 client_->SetEventObserver(nullptr); |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 const std::set<ui::Window*>& WindowManagerConnection::GetRoots() const { |
| 105 return client_->GetRoots(); |
| 106 } |
| 107 |
| 104 WindowManagerConnection::WindowManagerConnection( | 108 WindowManagerConnection::WindowManagerConnection( |
| 105 shell::Connector* connector, | 109 shell::Connector* connector, |
| 106 const shell::Identity& identity) | 110 const shell::Identity& identity) |
| 107 : connector_(connector), identity_(identity) { | 111 : connector_(connector), identity_(identity) { |
| 108 lazy_tls_ptr.Pointer()->Set(this); | 112 lazy_tls_ptr.Pointer()->Set(this); |
| 109 | 113 |
| 110 ui::GpuService::Initialize(connector); | 114 ui::GpuService::Initialize(connector); |
| 111 | 115 |
| 112 client_.reset(new ui::WindowTreeClient(this, nullptr, nullptr)); | 116 client_.reset(new ui::WindowTreeClient(this, nullptr, nullptr)); |
| 113 client_->ConnectViaWindowTreeFactory(connector_); | 117 client_->ConnectViaWindowTreeFactory(connector_); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { | 189 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { |
| 186 if (client_) | 190 if (client_) |
| 187 NativeWidgetMus::NotifyFrameChanged(client_.get()); | 191 NativeWidgetMus::NotifyFrameChanged(client_.get()); |
| 188 } | 192 } |
| 189 | 193 |
| 190 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { | 194 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { |
| 191 return client_->GetCursorScreenPoint(); | 195 return client_->GetCursorScreenPoint(); |
| 192 } | 196 } |
| 193 | 197 |
| 194 } // namespace views | 198 } // namespace views |
| OLD | NEW |