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

Unified Diff: ash/wm/ash_native_cursor_manager.cc

Issue 2780623002: exo: Fix multi-display hardware cursor (Closed)
Patch Set: Fix accessibility test Created 3 years, 7 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 45a3ef82f59b4d8ffeabbd7e72ab466b331897da..dfaa74d882d782cf5601bf6b262646f9ec9cb1a8 100644
--- a/ash/wm/ash_native_cursor_manager.cc
+++ b/ash/wm/ash_native_cursor_manager.cc
@@ -57,6 +57,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;
@@ -68,6 +76,11 @@ void AshNativeCursorManager::SetDisplay(
const display::Display& display,
::wm::NativeCursorManagerDelegate* delegate) {
DCHECK(display.is_valid());
+ cursor_display_ = display;
+
+ for (Observer& observer : observers_)
+ observer.OnCursorDisplayChanged(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::Get()

Powered by Google App Engine
This is Rietveld 408576698