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

Unified Diff: ash/wm/ash_native_cursor_manager.h

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.h
diff --git a/ash/wm/ash_native_cursor_manager.h b/ash/wm/ash_native_cursor_manager.h
index fac694dd960fa93e45f9c3272d8ba0fbed57a71b..b538d5f3a0053e01eba5b3b63c3f7f6e7ad73bc2 100644
--- a/ash/wm/ash_native_cursor_manager.h
+++ b/ash/wm/ash_native_cursor_manager.h
@@ -10,7 +10,9 @@
#include "ash/ash_export.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/observer_list.h"
#include "base/strings/string16.h"
+#include "ui/display/display.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/wm/core/native_cursor_manager.h"
@@ -32,9 +34,22 @@ class CursorManagerTestApi;
// changes were acted on.
class ASH_EXPORT AshNativeCursorManager : public ::wm::NativeCursorManager {
public:
+ class Observer {
+ public:
+ virtual void OnCursorDisplayChanged(const display::Display& display) = 0;
reveman 2017/05/31 03:33:10 Can we instead add this to CursorClientObserver an
Dominik Laskowski 2017/05/31 20:35:54 Good point. Much better than exposing internals.
+
+ protected:
+ virtual ~Observer() {}
+ };
+
AshNativeCursorManager();
~AshNativeCursorManager() override;
+ const display::Display& cursor_display() const { return cursor_display_; }
+
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
// Toggle native cursor enabled/disabled.
// The native cursor is enabled by default. When disabled, we hide the native
// cursor regardless of visibility state, and let CursorWindowManager draw
@@ -57,6 +72,9 @@ class ASH_EXPORT AshNativeCursorManager : public ::wm::NativeCursorManager {
bool enabled,
::wm::NativeCursorManagerDelegate* delegate) override;
+ // Display where the cursor is located.
+ display::Display cursor_display_;
+
// The cursor location where the cursor was disabled.
gfx::Point disabled_cursor_location_;
@@ -64,6 +82,8 @@ class ASH_EXPORT AshNativeCursorManager : public ::wm::NativeCursorManager {
std::unique_ptr<ui::ImageCursors> image_cursors_;
+ base::ObserverList<Observer> observers_;
+
DISALLOW_COPY_AND_ASSIGN(AshNativeCursorManager);
};
« no previous file with comments | « ash/shell.h ('k') | ash/wm/ash_native_cursor_manager.cc » ('j') | components/exo/pointer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698