| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ozone/platform/drm/cursor_proxy_mojo.h" | 5 #include "ui/ozone/platform/drm/cursor_proxy_mojo.h" |
| 6 | 6 |
| 7 #include "services/service_manager/public/cpp/connector.h" | 7 #include "services/service_manager/public/cpp/connector.h" |
| 8 #include "services/ui/public/interfaces/constants.mojom.h" |
| 8 | 9 |
| 9 namespace ui { | 10 namespace ui { |
| 10 | 11 |
| 11 CursorProxyMojo::CursorProxyMojo(service_manager::Connector* connector) | 12 CursorProxyMojo::CursorProxyMojo(service_manager::Connector* connector) |
| 12 : connector_(connector->Clone()) { | 13 : connector_(connector->Clone()) { |
| 13 connector->ConnectToInterface("ui", &main_cursor_ptr_); | 14 connector->ConnectToInterface(ui::mojom::kServiceName, &main_cursor_ptr_); |
| 14 } | 15 } |
| 15 | 16 |
| 16 void CursorProxyMojo::InitializeOnEvdev() { | 17 void CursorProxyMojo::InitializeOnEvdev() { |
| 17 evdev_ref_ = base::PlatformThread::CurrentRef(); | 18 evdev_ref_ = base::PlatformThread::CurrentRef(); |
| 18 connector_->ConnectToInterface("ui", &evdev_cursor_ptr_); | 19 connector_->ConnectToInterface(ui::mojom::kServiceName, &evdev_cursor_ptr_); |
| 19 } | 20 } |
| 20 | 21 |
| 21 CursorProxyMojo::~CursorProxyMojo() {} | 22 CursorProxyMojo::~CursorProxyMojo() {} |
| 22 | 23 |
| 23 void CursorProxyMojo::CursorSet(gfx::AcceleratedWidget widget, | 24 void CursorProxyMojo::CursorSet(gfx::AcceleratedWidget widget, |
| 24 const std::vector<SkBitmap>& bitmaps, | 25 const std::vector<SkBitmap>& bitmaps, |
| 25 const gfx::Point& location, | 26 const gfx::Point& location, |
| 26 int frame_delay_ms) { | 27 int frame_delay_ms) { |
| 27 if (evdev_ref_ == base::PlatformThread::CurrentRef()) { | 28 if (evdev_ref_ == base::PlatformThread::CurrentRef()) { |
| 28 evdev_cursor_ptr_->SetCursor(widget, bitmaps, location, frame_delay_ms); | 29 evdev_cursor_ptr_->SetCursor(widget, bitmaps, location, frame_delay_ms); |
| 29 } else { | 30 } else { |
| 30 main_cursor_ptr_->SetCursor(widget, bitmaps, location, frame_delay_ms); | 31 main_cursor_ptr_->SetCursor(widget, bitmaps, location, frame_delay_ms); |
| 31 } | 32 } |
| 32 } | 33 } |
| 33 | 34 |
| 34 void CursorProxyMojo::Move(gfx::AcceleratedWidget widget, | 35 void CursorProxyMojo::Move(gfx::AcceleratedWidget widget, |
| 35 const gfx::Point& location) { | 36 const gfx::Point& location) { |
| 36 if (evdev_ref_ == base::PlatformThread::CurrentRef()) { | 37 if (evdev_ref_ == base::PlatformThread::CurrentRef()) { |
| 37 evdev_cursor_ptr_->MoveCursor(widget, location); | 38 evdev_cursor_ptr_->MoveCursor(widget, location); |
| 38 } else { | 39 } else { |
| 39 main_cursor_ptr_->MoveCursor(widget, location); | 40 main_cursor_ptr_->MoveCursor(widget, location); |
| 40 } | 41 } |
| 41 } | 42 } |
| 42 | 43 |
| 43 } // namespace ui | 44 } // namespace ui |
| OLD | NEW |