Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Unified Diff: services/ui/ws/user_display_manager.cc

Issue 2696963003: Split cursor location from UserDisplayManager. (Closed)
Patch Set: Fix nits. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/user_display_manager.h ('k') | services/ui/ws/user_display_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/user_display_manager.cc
diff --git a/services/ui/ws/user_display_manager.cc b/services/ui/ws/user_display_manager.cc
index f33d797730c889f07ec279a9d1f79a40eb94e2e6..344b892e5cfe7ed3c221011562289ba6a7166c65 100644
--- a/services/ui/ws/user_display_manager.cc
+++ b/services/ui/ws/user_display_manager.cc
@@ -35,8 +35,7 @@ UserDisplayManager::UserDisplayManager(ws::DisplayManager* display_manager,
delegate_(delegate),
user_id_(user_id),
got_valid_frame_decorations_(
- delegate->GetFrameDecorationsForUser(user_id, nullptr)),
- current_cursor_location_(0) {}
+ delegate->GetFrameDecorationsForUser(user_id, nullptr)) {}
UserDisplayManager::~UserDisplayManager() {}
@@ -93,38 +92,6 @@ void UserDisplayManager::OnPrimaryDisplayChanged(int64_t primary_display_id) {
});
}
-void UserDisplayManager::OnMouseCursorLocationChanged(const gfx::Point& point) {
- current_cursor_location_ =
- static_cast<base::subtle::Atomic32>(
- (point.x() & 0xFFFF) << 16 | (point.y() & 0xFFFF));
- if (cursor_location_memory()) {
- base::subtle::NoBarrier_Store(cursor_location_memory(),
- current_cursor_location_);
- }
-}
-
-mojo::ScopedSharedBufferHandle UserDisplayManager::GetCursorLocationMemory() {
- if (!cursor_location_handle_.is_valid()) {
- // Create our shared memory segment to share the cursor state with our
- // window clients.
- cursor_location_handle_ =
- mojo::SharedBufferHandle::Create(sizeof(base::subtle::Atomic32));
-
- if (!cursor_location_handle_.is_valid())
- return mojo::ScopedSharedBufferHandle();
-
- cursor_location_mapping_ =
- cursor_location_handle_->Map(sizeof(base::subtle::Atomic32));
- if (!cursor_location_mapping_)
- return mojo::ScopedSharedBufferHandle();
- base::subtle::NoBarrier_Store(cursor_location_memory(),
- current_cursor_location_);
- }
-
- return cursor_location_handle_->Clone(
- mojo::SharedBufferHandle::AccessMode::READ_ONLY);
-}
-
void UserDisplayManager::AddObserver(
mojom::DisplayManagerObserverPtr observer) {
mojom::DisplayManagerObserver* observer_impl = observer.get();
« no previous file with comments | « services/ui/ws/user_display_manager.h ('k') | services/ui/ws/user_display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698