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

Unified Diff: ash/wm/ash_native_cursor_manager.cc

Issue 2780623002: exo: Fix multi-display hardware cursor (Closed)
Patch Set: Rebase properly Created 3 years, 9 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/wm/ash_native_cursor_manager.cc
diff --git a/ash/wm/ash_native_cursor_manager.cc b/ash/wm/ash_native_cursor_manager.cc
index d79bd5d0af84cb54b780dc2404d4d776b3b381f5..d71d695a95fc8eaf859ac4d521224b2c426966ad 100644
--- a/ash/wm/ash_native_cursor_manager.cc
+++ b/ash/wm/ash_native_cursor_manager.cc
@@ -60,6 +60,14 @@ AshNativeCursorManager::AshNativeCursorManager()
AshNativeCursorManager::~AshNativeCursorManager() {}
+void AshNativeCursorManager::AddObserver(Observer* observer) {
+ observers_.AddObserver(observer);
+}
+
+void AshNativeCursorManager::RemoveObserver(Observer* observer) {
+ observers_.RemoveObserver(observer);
+}
+
void AshNativeCursorManager::SetNativeCursorEnabled(bool enabled) {
native_cursor_enabled_ = enabled;
@@ -71,6 +79,10 @@ void AshNativeCursorManager::SetDisplay(
const display::Display& display,
::wm::NativeCursorManagerDelegate* delegate) {
DCHECK(display.is_valid());
+
+ for (Observer& observer : observers_)
+ observer.OnCursorDisplayChanging(display);
+
// Use the platform's device scale factor instead of the display's, which
// might have been adjusted for the UI scale.
const float original_scale = Shell::GetInstance()

Powered by Google App Engine
This is Rietveld 408576698