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

Unified Diff: services/ui/ws/window_manager_state.h

Issue 2208443002: Changes accelerators registered by mus to not interfere with those of client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 4 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
« no previous file with comments | « ash/mus/accelerators/accelerator_controller_registrar.cc ('k') | services/ui/ws/window_manager_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_manager_state.h
diff --git a/services/ui/ws/window_manager_state.h b/services/ui/ws/window_manager_state.h
index 9c758810e74bcbf0dd76f7592839df500a35df40..685f123645aab6de6c446f482d025c820c2f281f 100644
--- a/services/ui/ws/window_manager_state.h
+++ b/services/ui/ws/window_manager_state.h
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <memory>
+#include <vector>
#include "base/memory/weak_ptr.h"
#include "base/timer/timer.h"
@@ -87,6 +88,16 @@ class WindowManagerState : public EventDispatcherDelegate {
friend class Display;
friend class test::WindowManagerStateTestApi;
+ enum class DebugAcceleratorType {
+ PRINT_WINDOWS,
+ };
+
+ struct DebugAccelerator {
+ DebugAcceleratorType type;
+ ui::KeyboardCode key_code;
+ int event_flags;
+ };
+
enum class EventDispatchPhase {
// Not actively dispatching.
NONE,
@@ -131,6 +142,10 @@ class WindowManagerState : public EventDispatcherDelegate {
// time.
void OnEventAckTimeout(ClientSpecificId client_id);
+ // Implemenation of processing an event with a match phase of all. This
+ // handles debug accelerators and forwards to EventDispatcher.
+ void ProcessEventImpl(const ui::Event& event);
+
// Schedules an event to be processed later.
void QueueEvent(const ui::Event& event,
std::unique_ptr<ProcessedEventTarget> processed_event_target);
@@ -149,8 +164,12 @@ class WindowManagerState : public EventDispatcherDelegate {
// Registers accelerators used internally for debugging.
void AddDebugAccelerators();
- // Returns true if the accelerator was handled.
- bool HandleDebugAccelerator(uint32_t accelerator_id);
+ // Finds the debug accelerator for |event| and if one is found calls
+ // HandleDebugAccelerator().
+ void ProcessDebugAccelerator(const ui::Event& event);
+
+ // Runs the specified debug accelerator.
+ void HandleDebugAccelerator(DebugAcceleratorType type);
// Called when waiting for an event or accelerator to be processed by |tree|.
void ScheduleInputEventTimeout(WindowTree* tree);
@@ -191,6 +210,8 @@ class WindowManagerState : public EventDispatcherDelegate {
std::queue<std::unique_ptr<QueuedEvent>> event_queue_;
base::OneShotTimer event_ack_timer_;
+ std::vector<DebugAccelerator> debug_accelerators_;
+
EventDispatcher event_dispatcher_;
// PlatformDisplay that currently has capture.
« no previous file with comments | « ash/mus/accelerators/accelerator_controller_registrar.cc ('k') | services/ui/ws/window_manager_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698