| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 mus::Window* WindowManagerConnection::NewWindow( | 62 mus::Window* WindowManagerConnection::NewWindow( |
| 63 const std::map<std::string, std::vector<uint8_t>>& properties) { | 63 const std::map<std::string, std::vector<uint8_t>>& properties) { |
| 64 return window_tree_connection_->NewTopLevelWindow(&properties); | 64 return window_tree_connection_->NewTopLevelWindow(&properties); |
| 65 } | 65 } |
| 66 | 66 |
| 67 NativeWidget* WindowManagerConnection::CreateNativeWidgetMus( | 67 NativeWidget* WindowManagerConnection::CreateNativeWidgetMus( |
| 68 const std::map<std::string, std::vector<uint8_t>>& props, | 68 const std::map<std::string, std::vector<uint8_t>>& props, |
| 69 const Widget::InitParams& init_params, | 69 const Widget::InitParams& init_params, |
| 70 internal::NativeWidgetDelegate* delegate) { | 70 internal::NativeWidgetDelegate* delegate) { |
| 71 // TYPE_CONTROL widgets require a NativeWidgetAura. So we let this fall |
| 72 // through, so that the default NativeWidgetPrivate::CreateNativeWidget() is |
| 73 // used instead. |
| 74 if (init_params.type == Widget::InitParams::TYPE_CONTROL) |
| 75 return nullptr; |
| 71 std::map<std::string, std::vector<uint8_t>> properties = props; | 76 std::map<std::string, std::vector<uint8_t>> properties = props; |
| 72 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties); | 77 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties); |
| 73 properties[mus::mojom::WindowManager::kAppID_Property] = | 78 properties[mus::mojom::WindowManager::kAppID_Property] = |
| 74 mojo::ConvertTo<std::vector<uint8_t>>(identity_.name()); | 79 mojo::ConvertTo<std::vector<uint8_t>>(identity_.name()); |
| 75 return new NativeWidgetMus(delegate, connector_, NewWindow(properties), | 80 return new NativeWidgetMus(delegate, connector_, NewWindow(properties), |
| 76 mus::mojom::SurfaceType::DEFAULT); | 81 mus::mojom::SurfaceType::DEFAULT); |
| 77 } | 82 } |
| 78 | 83 |
| 79 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher) { | 84 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher) { |
| 80 bool had_watcher = HasPointerWatcher(); | 85 bool had_watcher = HasPointerWatcher(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { | 174 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { |
| 170 if (window_tree_connection_) | 175 if (window_tree_connection_) |
| 171 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get()); | 176 NativeWidgetMus::NotifyFrameChanged(window_tree_connection_.get()); |
| 172 } | 177 } |
| 173 | 178 |
| 174 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { | 179 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { |
| 175 return window_tree_connection_->GetCursorScreenPoint(); | 180 return window_tree_connection_->GetCursorScreenPoint(); |
| 176 } | 181 } |
| 177 | 182 |
| 178 } // namespace views | 183 } // namespace views |
| OLD | NEW |