| 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 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 // static | 39 // static |
| 40 WindowManagerConnection* WindowManagerConnection::Get() { | 40 WindowManagerConnection* WindowManagerConnection::Get() { |
| 41 WindowManagerConnection* connection = lazy_tls_ptr.Pointer()->Get(); | 41 WindowManagerConnection* connection = lazy_tls_ptr.Pointer()->Get(); |
| 42 DCHECK(connection); | 42 DCHECK(connection); |
| 43 return connection; | 43 return connection; |
| 44 } | 44 } |
| 45 | 45 |
| 46 // static | 46 // static |
| 47 bool WindowManagerConnection::Exists() { |
| 48 return !!lazy_tls_ptr.Pointer()->Get(); |
| 49 } |
| 50 |
| 51 // static |
| 47 void WindowManagerConnection::Reset() { | 52 void WindowManagerConnection::Reset() { |
| 48 delete Get(); | 53 delete Get(); |
| 49 lazy_tls_ptr.Pointer()->Set(nullptr); | 54 lazy_tls_ptr.Pointer()->Set(nullptr); |
| 50 } | 55 } |
| 51 | 56 |
| 52 mus::Window* WindowManagerConnection::NewWindow( | 57 mus::Window* WindowManagerConnection::NewWindow( |
| 53 const std::map<std::string, std::vector<uint8_t>>& properties) { | 58 const std::map<std::string, std::vector<uint8_t>>& properties) { |
| 54 return window_tree_connection_->NewTopLevelWindow(&properties); | 59 return window_tree_connection_->NewTopLevelWindow(&properties); |
| 55 } | 60 } |
| 56 | 61 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 93 |
| 89 void WindowManagerConnection::OnConnectionLost( | 94 void WindowManagerConnection::OnConnectionLost( |
| 90 mus::WindowTreeConnection* connection) {} | 95 mus::WindowTreeConnection* connection) {} |
| 91 | 96 |
| 92 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { | 97 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { |
| 93 if (window_tree_connection_) | 98 if (window_tree_connection_) |
| 94 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get()); | 99 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get()); |
| 95 } | 100 } |
| 96 | 101 |
| 97 } // namespace views | 102 } // namespace views |
| OLD | NEW |