| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 internal::NativeWidgetDelegate* delegate) { | 84 internal::NativeWidgetDelegate* delegate) { |
| 85 // TYPE_CONTROL widgets require a NativeWidgetAura. So we let this fall | 85 // TYPE_CONTROL widgets require a NativeWidgetAura. So we let this fall |
| 86 // through, so that the default NativeWidgetPrivate::CreateNativeWidget() is | 86 // through, so that the default NativeWidgetPrivate::CreateNativeWidget() is |
| 87 // used instead. | 87 // used instead. |
| 88 if (init_params.type == Widget::InitParams::TYPE_CONTROL) | 88 if (init_params.type == Widget::InitParams::TYPE_CONTROL) |
| 89 return nullptr; | 89 return nullptr; |
| 90 std::map<std::string, std::vector<uint8_t>> properties = props; | 90 std::map<std::string, std::vector<uint8_t>> properties = props; |
| 91 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties); | 91 NativeWidgetMus::ConfigurePropertiesForNewWindow(init_params, &properties); |
| 92 properties[ui::mojom::WindowManager::kAppID_Property] = | 92 properties[ui::mojom::WindowManager::kAppID_Property] = |
| 93 mojo::ConvertTo<std::vector<uint8_t>>(identity_.name()); | 93 mojo::ConvertTo<std::vector<uint8_t>>(identity_.name()); |
| 94 return new NativeWidgetMus(delegate, connector_, NewWindow(properties), | 94 return new NativeWidgetMus(delegate, NewWindow(properties), |
| 95 ui::mojom::SurfaceType::DEFAULT); | 95 ui::mojom::SurfaceType::DEFAULT); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher) { | 98 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher) { |
| 99 // TODO(riajiang): Support multiple event matchers (crbug.com/627146). | 99 // TODO(riajiang): Support multiple event matchers (crbug.com/627146). |
| 100 DCHECK(!HasTouchEventWatcher()); | 100 DCHECK(!HasTouchEventWatcher()); |
| 101 bool had_watcher = HasPointerWatcher(); | 101 bool had_watcher = HasPointerWatcher(); |
| 102 pointer_watchers_.AddObserver(watcher); | 102 pointer_watchers_.AddObserver(watcher); |
| 103 if (!had_watcher) { | 103 if (!had_watcher) { |
| 104 // Start a watcher for pointer down. | 104 // Start a watcher for pointer down. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { | 231 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { |
| 232 if (client_) | 232 if (client_) |
| 233 NativeWidgetMus::NotifyFrameChanged(client_.get()); | 233 NativeWidgetMus::NotifyFrameChanged(client_.get()); |
| 234 } | 234 } |
| 235 | 235 |
| 236 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { | 236 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { |
| 237 return client_->GetCursorScreenPoint(); | 237 return client_->GetCursorScreenPoint(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace views | 240 } // namespace views |
| OLD | NEW |