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

Unified Diff: chrome/browser/renderer_host/render_view_host.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/renderer_host/render_view_host.cc
===================================================================
--- chrome/browser/renderer_host/render_view_host.cc (revision 34219)
+++ chrome/browser/renderer_host/render_view_host.cc (working copy)
@@ -1477,20 +1477,17 @@
UserMetrics::RecordComputedAction(action.c_str(), process()->profile());
}
-bool RenderViewHost::ShouldSendToRenderer(const NativeWebKeyboardEvent& event) {
+bool RenderViewHost::PreHandleKeyboardEvent(
+ const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) {
RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
- if (!view)
- return true;
- return !view->IsReservedAccelerator(event);
+ return view && view->PreHandleKeyboardEvent(event, is_keyboard_shortcut);
}
-bool RenderViewHost::UnhandledKeyboardEvent(
+void RenderViewHost::UnhandledKeyboardEvent(
const NativeWebKeyboardEvent& event) {
RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
- if (view) {
- return view->HandleKeyboardEvent(event);
- }
- return false;
+ if (view)
+ view->HandleKeyboardEvent(event);
}
void RenderViewHost::OnUserGesture() {
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.h ('k') | chrome/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698