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

Unified Diff: chrome/browser/views/tab_contents/tab_contents_view_gtk.cc

Issue 400012: Refactor the keyboard events handling code related to RenderViewHostDelegate:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years 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: chrome/browser/views/tab_contents/tab_contents_view_gtk.cc
===================================================================
--- chrome/browser/views/tab_contents/tab_contents_view_gtk.cc (revision 34219)
+++ chrome/browser/views/tab_contents/tab_contents_view_gtk.cc (working copy)
@@ -314,37 +314,6 @@
reverse ? GTK_DIR_TAB_BACKWARD : GTK_DIR_TAB_FORWARD);
}
-bool TabContentsViewGtk::HandleKeyboardEvent(
- const NativeWebKeyboardEvent& event) {
- // The renderer returned a keyboard event it did not process. This may be
- // a keyboard shortcut that we have to process.
- if (event.type != WebInputEvent::RawKeyDown)
- return false;
-
- views::FocusManager* focus_manager =
- views::FocusManager::GetFocusManagerForNativeView(GetNativeView());
- // We may not have a focus_manager at this point (if the tab has been switched
- // by the time this message returned).
- if (!focus_manager)
- return false;
-
- bool shift_pressed = (event.modifiers & WebInputEvent::ShiftKey) ==
- WebInputEvent::ShiftKey;
- bool ctrl_pressed = (event.modifiers & WebInputEvent::ControlKey) ==
- WebInputEvent::ControlKey;
- bool alt_pressed = (event.modifiers & WebInputEvent::AltKey) ==
- WebInputEvent::AltKey;
-
- return focus_manager->ProcessAccelerator(
- views::Accelerator(static_cast<base::KeyboardCode>(event.windowsKeyCode),
- shift_pressed, ctrl_pressed, alt_pressed));
- // DANGER: |this| could be deleted now!
-
- // Note that we do not handle Gtk mnemonics/accelerators or binding set here
- // (as it is done in BrowserWindowGtk::HandleKeyboardEvent), as we override
- // Gtk behavior completely.
-}
-
void TabContentsViewGtk::ShowContextMenu(const ContextMenuParams& params) {
// Allow delegates to handle the context menu operation first.
if (tab_contents()->delegate()->HandleContextMenu(params))
« no previous file with comments | « chrome/browser/views/tab_contents/tab_contents_view_gtk.h ('k') | chrome/browser/views/tab_contents/tab_contents_view_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698