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

Unified Diff: ui/aura/desktop.cc

Issue 8585007: Added hotkey support to 8508009 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed compile issue Created 9 years, 1 month 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 | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_) {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698