| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 std::map<std::string, std::vector<uint8_t>> properties = props; | 66 std::map<std::string, std::vector<uint8_t>> properties = props; |
| 67 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties); | 67 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties); |
| 68 return new NativeWidgetMus(delegate, connector_, NewWindow(properties), | 68 return new NativeWidgetMus(delegate, connector_, NewWindow(properties), |
| 69 mus::mojom::SurfaceType::DEFAULT); | 69 mus::mojom::SurfaceType::DEFAULT); |
| 70 } | 70 } |
| 71 | 71 |
| 72 WindowManagerConnection::WindowManagerConnection(shell::Connector* connector) | 72 WindowManagerConnection::WindowManagerConnection(shell::Connector* connector) |
| 73 : connector_(connector), window_tree_connection_(nullptr) { | 73 : connector_(connector), window_tree_connection_(nullptr) { |
| 74 window_tree_connection_.reset( | 74 window_tree_connection_.reset( |
| 75 mus::WindowTreeConnection::Create(this, connector_)); | 75 mus::WindowTreeConnection::Create(this, connector_)); |
| 76 window_tree_connection_->InitializeCursorLocation(); |
| 76 | 77 |
| 77 screen_.reset(new ScreenMus(this)); | 78 screen_.reset(new ScreenMus(this)); |
| 78 screen_->Init(connector); | 79 screen_->Init(connector); |
| 79 | 80 |
| 80 // TODO(sad): We should have a DeviceDataManager implementation that talks to | 81 // TODO(sad): We should have a DeviceDataManager implementation that talks to |
| 81 // a mojo service to learn about the input-devices on the system. | 82 // a mojo service to learn about the input-devices on the system. |
| 82 // http://crbug.com/601981 | 83 // http://crbug.com/601981 |
| 83 ui::DeviceDataManager::CreateInstance(); | 84 ui::DeviceDataManager::CreateInstance(); |
| 84 | 85 |
| 85 ViewsDelegate::GetInstance()->set_native_widget_factory(base::Bind( | 86 ViewsDelegate::GetInstance()->set_native_widget_factory(base::Bind( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 99 void WindowManagerConnection::OnEmbed(mus::Window* root) {} | 100 void WindowManagerConnection::OnEmbed(mus::Window* root) {} |
| 100 | 101 |
| 101 void WindowManagerConnection::OnConnectionLost( | 102 void WindowManagerConnection::OnConnectionLost( |
| 102 mus::WindowTreeConnection* connection) {} | 103 mus::WindowTreeConnection* connection) {} |
| 103 | 104 |
| 104 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { | 105 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { |
| 105 if (window_tree_connection_) | 106 if (window_tree_connection_) |
| 106 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get()); | 107 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get()); |
| 107 } | 108 } |
| 108 | 109 |
| 110 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { |
| 111 return window_tree_connection_->GetCursorScreenPoint(); |
| 112 } |
| 113 |
| 109 } // namespace views | 114 } // namespace views |
| OLD | NEW |