Index: ui/aura/desktop.cc |
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc |
index 58eaec2eb326301adba392be383f7eb24071b472..983a6a3d027bea4327ae101ac4cce623fbb7094e 100644 |
--- a/ui/aura/desktop.cc |
+++ b/ui/aura/desktop.cc |
@@ -25,6 +25,7 @@ |
#include "ui/aura/window_delegate.h" |
#include "ui/base/hit_test.h" |
#include "ui/gfx/compositor/compositor.h" |
+#include "ui/gfx/compositor/debug_utils.h" |
#include "ui/gfx/compositor/layer.h" |
#include "ui/gfx/compositor/layer_animation_sequence.h" |
#include "ui/gfx/compositor/layer_animator.h" |
@@ -137,6 +138,15 @@ bool MaybeRotate(Desktop* desktop, KeyEvent* event) { |
} |
return false; |
} |
+ |
+bool MaybePrintDebug(Desktop* desktop, KeyEvent* event) { |
Ben Goodger (Google)
2011/11/17 21:03:17
Can you wait until mazda lands his keyboard stuff?
|
+ if ((event->flags() & ui::EF_ALT_DOWN) && |
+ event->key_code() == ui::VKEY_L) { |
+ ui::PrintLayerHierarchy(desktop->layer()); |
+ return true; |
+ } |
+ return false; |
+} |
#endif |
} // namespace |
@@ -160,7 +170,7 @@ Desktop::Desktop() |
mouse_moved_handler_(NULL), |
focused_window_(NULL), |
touch_event_handler_(NULL) { |
- set_name("RootWindow"); |
+ SetName("RootWindow"); |
gfx::Screen::SetInstance(screen_); |
host_->SetDesktop(this); |
last_mouse_location_ = host_->QueryMouseLocation(); |
@@ -280,6 +290,9 @@ bool Desktop::DispatchKeyEvent(KeyEvent* event) { |
if (MaybeFullScreen(host_.get(), event) || MaybeRotate(this, event)) |
return true; |
} |
+ |
+ if (event->type() == ui::ET_KEY_RELEASED && MaybePrintDebug(this, event)) |
+ return true; |
#endif |
if (focused_window_) { |