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

Unified Diff: components/mus/ws/event_dispatcher.h

Issue 1818333002: Reland: mus: Enable system modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up comments Created 4 years, 8 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: components/mus/ws/event_dispatcher.h
diff --git a/components/mus/ws/event_dispatcher.h b/components/mus/ws/event_dispatcher.h
index 81bf4a09a122d4b6b890e73a342de88e3c5e6176..f9bcdc3336aadfbacde8fbc15d6011731609a4d9 100644
--- a/components/mus/ws/event_dispatcher.h
+++ b/components/mus/ws/event_dispatcher.h
@@ -60,6 +60,15 @@ class EventDispatcher : public ServerWindowObserver {
// (indicated by returning |false|).
bool SetCaptureWindow(ServerWindow* capture_window, bool in_nonclient_area);
+ ServerWindow* system_modal_window() { return system_modal_window_; }
+ const ServerWindow* system_modal_window() const {
+ return system_modal_window_;
+ }
+
+ // |window| cannot be nullptr. The only way to unset system modal window is by
+ // destroying it.
+ bool SetSystemModalWindow(ServerWindow* window);
+
// Retrieves the ServerWindow of the last mouse move.
ServerWindow* mouse_cursor_source_window() const {
return mouse_cursor_source_window_;
@@ -148,9 +157,11 @@ class EventDispatcher : public ServerWindowObserver {
// way we continue to eat events until the up/cancel is received.
void CancelPointerEventsToTarget(ServerWindow* window);
- // Returns true if we're currently an observer for |window|. We are an
- // observer for a window if any pointer events are targeting it.
- bool IsObservingWindow(ServerWindow* window);
+ // Used to observe a window. Can be called multiple times on a window. To
+ // unobserve a window, UnobserveWindow() should be called the same number of
+ // times.
+ void ObserveWindow(ServerWindow* winodw);
+ void UnobserveWindow(ServerWindow* winodw);
// Returns an Accelerator bound to the specified code/flags, and of the
// matching |phase|. Otherwise returns null.
@@ -166,9 +177,12 @@ class EventDispatcher : public ServerWindowObserver {
EventDispatcherDelegate* delegate_;
ServerWindow* root_;
- ServerWindow* capture_window_;
+ ServerWindow* capture_window_;
bool capture_window_in_nonclient_area_;
+
+ ServerWindow* system_modal_window_;
+
bool mouse_button_down_;
ServerWindow* mouse_cursor_source_window_;
@@ -188,6 +202,9 @@ class EventDispatcher : public ServerWindowObserver {
// cancel or up.
PointerIdToTargetMap pointer_targets_;
+ // Keeps track of number of observe requests for observed windows.
+ std::map<const ServerWindow*, uint8_t> observed_windows_;
+
DISALLOW_COPY_AND_ASSIGN(EventDispatcher);
};

Powered by Google App Engine
This is Rietveld 408576698