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

Unified Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 224023: Don't send tab switching/killing/creating keyboard accelerators to pages. Th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: call Browser:IsReservedAccelerator from tab_contents_view.cc instead of each platform file Created 11 years, 3 months 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 27783)
+++ chrome/browser/renderer_host/render_view_host.cc (working copy)
@@ -1420,19 +1420,18 @@
UserMetrics::RecordComputedAction(action.c_str(), process()->profile());
}
+bool RenderViewHost::ShouldSendToRenderer(const NativeWebKeyboardEvent& event) {
+ RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
+ if (!view)
+ return true;
+ return !view->IsReservedAccelerator(event);
+}
+
void RenderViewHost::UnhandledKeyboardEvent(
const NativeWebKeyboardEvent& event) {
RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
- if (view) {
- // TODO(brettw) why do we have to filter these types of events here. Can't
- // the renderer just send us the ones we care abount, or maybe the view
- // should be able to decide which ones it wants or not?
- if ((event.type == WebInputEvent::RawKeyDown) ||
- (event.type == WebInputEvent::KeyDown) ||
- (event.type == WebInputEvent::Char)) {
- view->HandleKeyboardEvent(event);
- }
- }
+ if (view)
+ view->HandleKeyboardEvent(event);
}
void RenderViewHost::OnUserGesture() {

Powered by Google App Engine
This is Rietveld 408576698