| 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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 internal::NativeWidgetDelegate* delegate) { | 88 internal::NativeWidgetDelegate* delegate) { |
| 89 // TYPE_CONTROL widgets require a NativeWidgetAura. So we let this fall | 89 // TYPE_CONTROL widgets require a NativeWidgetAura. So we let this fall |
| 90 // through, so that the default NativeWidgetPrivate::CreateNativeWidget() is | 90 // through, so that the default NativeWidgetPrivate::CreateNativeWidget() is |
| 91 // used instead. | 91 // used instead. |
| 92 if (init_params.type == Widget::InitParams::TYPE_CONTROL) | 92 if (init_params.type == Widget::InitParams::TYPE_CONTROL) |
| 93 return nullptr; | 93 return nullptr; |
| 94 std::map<std::string, std::vector<uint8_t>> properties = props; | 94 std::map<std::string, std::vector<uint8_t>> properties = props; |
| 95 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties); | 95 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties); |
| 96 properties[ui::mojom::WindowManager::kAppID_Property] = | 96 properties[ui::mojom::WindowManager::kAppID_Property] = |
| 97 mojo::ConvertTo<std::vector<uint8_t>>(identity_.name()); | 97 mojo::ConvertTo<std::vector<uint8_t>>(identity_.name()); |
| 98 return new NativeWidgetMus(delegate, NewWindow(properties), | 98 NativeWidgetMus* native_widget = new NativeWidgetMus( |
| 99 ui::mojom::SurfaceType::DEFAULT); | 99 delegate, NewWindow(properties), ui::mojom::SurfaceType::DEFAULT); |
| 100 native_widget->window_tree_host()->InitInputMethod(connector_); |
| 101 return native_widget; |
| 100 } | 102 } |
| 101 | 103 |
| 102 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher, | 104 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher, |
| 103 bool want_moves) { | 105 bool want_moves) { |
| 104 // Pointer watchers cannot be added multiple times. | 106 // Pointer watchers cannot be added multiple times. |
| 105 DCHECK(!pointer_watchers_.HasObserver(watcher)); | 107 DCHECK(!pointer_watchers_.HasObserver(watcher)); |
| 106 // TODO(jamescook): Support adding pointer watchers with different | 108 // TODO(jamescook): Support adding pointer watchers with different |
| 107 // |want_moves| values by tracking whether the set as a whole wants moves. | 109 // |want_moves| values by tracking whether the set as a whole wants moves. |
| 108 // This will involve sending observed move events to a subset of the | 110 // This will involve sending observed move events to a subset of the |
| 109 // watchers. (crbug.com/627146) | 111 // watchers. (crbug.com/627146) |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { | 208 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { |
| 207 return client_->GetCursorScreenPoint(); | 209 return client_->GetCursorScreenPoint(); |
| 208 } | 210 } |
| 209 | 211 |
| 210 std::unique_ptr<OSExchangeData::Provider> | 212 std::unique_ptr<OSExchangeData::Provider> |
| 211 WindowManagerConnection::BuildProvider() { | 213 WindowManagerConnection::BuildProvider() { |
| 212 return base::MakeUnique<OSExchangeDataProviderMus>(); | 214 return base::MakeUnique<OSExchangeDataProviderMus>(); |
| 213 } | 215 } |
| 214 | 216 |
| 215 } // namespace views | 217 } // namespace views |
| OLD | NEW |