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

Unified Diff: ash/mus/bridge/shell_port_mash.cc

Issue 2957313003: Make ShellPortMash also dispatch to cursor_manager in mus mode. (Closed)
Patch Set: Rebase to ToT Created 3 years, 6 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
Index: ash/mus/bridge/shell_port_mash.cc
diff --git a/ash/mus/bridge/shell_port_mash.cc b/ash/mus/bridge/shell_port_mash.cc
index 58fa0608d8f44d272a2c8c6b6b013bde0800a98e..1495cf097ec0a90d632180520f29fc5bfc7ce2bf 100644
--- a/ash/mus/bridge/shell_port_mash.cc
+++ b/ash/mus/bridge/shell_port_mash.cc
@@ -131,27 +131,47 @@ ShellPortMash::CreateTouchTransformDelegate() {
}
void ShellPortMash::LockCursor() {
- window_manager_->window_manager_client()->LockCursor();
+ // When we are running in mus, we need to keep track of state not just in the
+ // window server, but also locally in ash because ash treats the cursor
+ // manager as the canonical state for now. NativeCursorManagerAsh will keep
+ // this state, while also forwarding it to the window manager for us.
+ if (mus_state_)
James Cook 2017/06/29 19:43:24 nit: I think these if()s would be clearer if they
Elliot Glaysher 2017/06/29 21:39:36 Done.
+ Shell::Get()->cursor_manager()->LockCursor();
+ else
+ window_manager_->window_manager_client()->LockCursor();
}
void ShellPortMash::UnlockCursor() {
- window_manager_->window_manager_client()->UnlockCursor();
+ if (mus_state_)
+ Shell::Get()->cursor_manager()->UnlockCursor();
+ else
+ window_manager_->window_manager_client()->UnlockCursor();
}
void ShellPortMash::ShowCursor() {
- window_manager_->window_manager_client()->SetCursorVisible(true);
+ if (mus_state_)
+ Shell::Get()->cursor_manager()->ShowCursor();
+ else
+ window_manager_->window_manager_client()->SetCursorVisible(true);
}
void ShellPortMash::HideCursor() {
- window_manager_->window_manager_client()->SetCursorVisible(false);
+ if (mus_state_)
+ Shell::Get()->cursor_manager()->HideCursor();
+ else
+ window_manager_->window_manager_client()->SetCursorVisible(false);
}
void ShellPortMash::SetCursorSize(ui::CursorSize cursor_size) {
- window_manager_->window_manager_client()->SetCursorSize(cursor_size);
+ if (mus_state_)
+ Shell::Get()->cursor_manager()->SetCursorSize(cursor_size);
+ else
+ window_manager_->window_manager_client()->SetCursorSize(cursor_size);
}
void ShellPortMash::SetGlobalOverrideCursor(
base::Optional<ui::CursorData> cursor) {
+ DCHECK(mash_state_);
window_manager_->window_manager_client()->SetGlobalOverrideCursor(
std::move(cursor));
}
« no previous file with comments | « no previous file | ash/wm/native_cursor_manager_ash_mus.cc » ('j') | testing/buildbot/filters/ash_unittests_mus.filter » ('J')

Powered by Google App Engine
This is Rietveld 408576698