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