summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorsuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 10:41:56 +0000
committersuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 10:41:56 +0000
commitb01c95ff55e33006086ea233b93909515822ffc7 (patch)
treebcbd7051828afbc9c0aeba99566f31481bac60ab /chrome/browser
parenta6fb1417e1c35469835a6066f5fadaeadd6bfb69 (diff)
downloadchromium_src-b01c95ff55e33006086ea233b93909515822ffc7.zip
chromium_src-b01c95ff55e33006086ea233b93909515822ffc7.tar.gz
chromium_src-b01c95ff55e33006086ea233b93909515822ffc7.tar.bz2
Fix issue: 32015: Keyboard shortcuts doesn't work when Devtool is docked
BUG=32015 TEST=Open devtool window and dock it into the browser window and move the focus into the devtool tab, then try if shortcut keys like ctrl-t are still work. Review URL: http://codereview.chromium.org/542049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/debugger/devtools_window.cc14
-rw-r--r--chrome/browser/debugger/devtools_window.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc
index 9127c6c..5066bfa 100644
--- a/chrome/browser/debugger/devtools_window.cc
+++ b/chrome/browser/debugger/devtools_window.cc
@@ -247,3 +247,17 @@ void DevToolsWindow::OpenConsole() {
tab_contents_->render_view_host()->
ExecuteJavascriptInWebFrame(L"", L"WebInspector.showConsole();");
}
+
+bool DevToolsWindow::PreHandleKeyboardEvent(
+ const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) {
+ if (docked_ && inspected_window_) {
+ return inspected_window_->PreHandleKeyboardEvent(
+ event, is_keyboard_shortcut);
+ }
+ return false;
+}
+
+void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
+ if (docked_ && inspected_window_)
+ inspected_window_->HandleKeyboardEvent(event);
+}
diff --git a/chrome/browser/debugger/devtools_window.h b/chrome/browser/debugger/devtools_window.h
index 5350934..7db20a9 100644
--- a/chrome/browser/debugger/devtools_window.h
+++ b/chrome/browser/debugger/devtools_window.h
@@ -82,6 +82,9 @@ class DevToolsWindow
virtual void URLStarredChanged(TabContents* source, bool starred) {}
virtual void UpdateTargetURL(TabContents* source, const GURL& url) {}
virtual void ToolbarSizeChanged(TabContents* source, bool is_animating) {}
+ virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
+ bool* is_keyboard_shortcut);
+ virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
Profile* profile_;
TabContents* inspected_tab_;