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

Side by Side 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, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_host/render_view_host.h" 5 #include "chrome/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 } 1413 }
1414 1414
1415 void RenderViewHost::OnToggleInspectElementMode(bool enabled) { 1415 void RenderViewHost::OnToggleInspectElementMode(bool enabled) {
1416 DevToolsManager::GetInstance()->ToggleInspectElementMode(this, enabled); 1416 DevToolsManager::GetInstance()->ToggleInspectElementMode(this, enabled);
1417 } 1417 }
1418 1418
1419 void RenderViewHost::OnUserMetricsRecordAction(const std::wstring& action) { 1419 void RenderViewHost::OnUserMetricsRecordAction(const std::wstring& action) {
1420 UserMetrics::RecordComputedAction(action.c_str(), process()->profile()); 1420 UserMetrics::RecordComputedAction(action.c_str(), process()->profile());
1421 } 1421 }
1422 1422
1423 bool RenderViewHost::ShouldSendToRenderer(const NativeWebKeyboardEvent& event) {
1424 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
1425 if (!view)
1426 return true;
1427 return !view->IsReservedAccelerator(event);
1428 }
1429
1423 void RenderViewHost::UnhandledKeyboardEvent( 1430 void RenderViewHost::UnhandledKeyboardEvent(
1424 const NativeWebKeyboardEvent& event) { 1431 const NativeWebKeyboardEvent& event) {
1425 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); 1432 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
1426 if (view) { 1433 if (view)
1427 // TODO(brettw) why do we have to filter these types of events here. Can't 1434 view->HandleKeyboardEvent(event);
1428 // the renderer just send us the ones we care abount, or maybe the view
1429 // should be able to decide which ones it wants or not?
1430 if ((event.type == WebInputEvent::RawKeyDown) ||
1431 (event.type == WebInputEvent::KeyDown) ||
1432 (event.type == WebInputEvent::Char)) {
1433 view->HandleKeyboardEvent(event);
1434 }
1435 }
1436 } 1435 }
1437 1436
1438 void RenderViewHost::OnUserGesture() { 1437 void RenderViewHost::OnUserGesture() {
1439 RenderViewHostDelegate::BrowserIntegration* integration_delegate = 1438 RenderViewHostDelegate::BrowserIntegration* integration_delegate =
1440 delegate_->GetBrowserIntegrationDelegate(); 1439 delegate_->GetBrowserIntegrationDelegate();
1441 if (integration_delegate) 1440 if (integration_delegate)
1442 integration_delegate->OnUserGesture(); 1441 integration_delegate->OnUserGesture();
1443 } 1442 }
1444 1443
1445 void RenderViewHost::OnMissingPluginStatus(int status) { 1444 void RenderViewHost::OnMissingPluginStatus(int status) {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 #endif 1672 #endif
1674 } 1673 }
1675 1674
1676 void RenderViewHost::OnCSSInserted() { 1675 void RenderViewHost::OnCSSInserted() {
1677 delegate_->DidInsertCSS(); 1676 delegate_->DidInsertCSS();
1678 } 1677 }
1679 1678
1680 void RenderViewHost::UpdateBrowserWindowId(int window_id) { 1679 void RenderViewHost::UpdateBrowserWindowId(int window_id) {
1681 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id)); 1680 Send(new ViewMsg_UpdateBrowserWindowId(routing_id(), window_id));
1682 } 1681 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698