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

Unified Diff: components/mus/ws/window_manager_state.cc

Issue 1953193002: mus: Add debug key to print the server window hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: components/mus/ws/window_manager_state.cc
diff --git a/components/mus/ws/window_manager_state.cc b/components/mus/ws/window_manager_state.cc
index 681a52345687cd9536817f4c5dbb4ef4d18303b6..cb4e536ba4bf489cb54e6f0cfc159ebd5c17bcde 100644
--- a/components/mus/ws/window_manager_state.cc
+++ b/components/mus/ws/window_manager_state.cc
@@ -214,6 +214,8 @@ void WindowManagerState::Deactivate() {
}
void WindowManagerState::ProcessEvent(const ui::Event& event) {
+ RunDebugShortcuts(event);
+
// If this is still waiting for an ack from a previously sent event, then
// queue up the event to be dispatched once the ack is received.
if (event_ack_timer_.IsRunning()) {
@@ -336,6 +338,20 @@ void WindowManagerState::DispatchInputEventToWindowImpl(
tree->DispatchInputEvent(target, event);
}
+void WindowManagerState::RunDebugShortcuts(const ui::Event& event) {
msw 2016/05/05 22:12:08 Should this instead use accelerators, like ash/acc
James Cook 2016/05/05 22:53:18 It seems like overkill. Ash already has an acceler
msw 2016/05/05 23:10:06 See if it's easy to add an accelerator to the Even
+#if !defined(NDEBUG)
+ if (event.type() != ui::ET_KEY_PRESSED)
+ return;
+ const ui::KeyEvent* key = event.AsKeyEvent();
+ if (key->key_code() == ui::VKEY_S && key->IsControlDown()
+ && key->IsShiftDown() && key->IsAltDown()) {
+ // Error so it will be collected in system logs.
+ LOG(ERROR) << "ServerWindow hierarchy:\n"
+ << root()->GetDebugWindowHierarchy();
+ }
+#endif
+}
+
////////////////////////////////////////////////////////////////////////////////
// EventDispatcherDelegate:
« components/mus/ws/server_window.cc ('K') | « components/mus/ws/window_manager_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698