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

Unified Diff: chrome/browser/render_view_host.cc

Issue 7650: Move more platform-specific stuff from WebContents to the view.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/render_view_host_delegate.h » ('j') | chrome/browser/web_contents.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/render_view_host.cc
===================================================================
--- chrome/browser/render_view_host.cc (revision 3558)
+++ chrome/browser/render_view_host.cc (working copy)
@@ -954,6 +954,10 @@
void RenderViewHost::OnMsgContextMenu(
const ViewHostMsg_ContextMenu_Params& params) {
+ RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
+ if (!view)
+ return;
+
// Validate the URLs in |params|. If the renderer can't request the URLs
// directly, don't show them in the context menu.
ViewHostMsg_ContextMenu_Params validated_params(params);
@@ -965,7 +969,7 @@
FilterURL(policy, renderer_id, &validated_params.page_url);
FilterURL(policy, renderer_id, &validated_params.frame_url);
- delegate_->ShowContextMenu(validated_params);
+ view->ShowContextMenu(validated_params);
}
void RenderViewHost::OnMsgOpenURL(const GURL& url,
@@ -1054,15 +1058,21 @@
void RenderViewHost::OnMsgStartDragging(
const WebDropData& drop_data) {
- delegate_->StartDragging(drop_data);
+ RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
+ if (view)
+ view->StartDragging(drop_data);
}
void RenderViewHost::OnUpdateDragCursor(bool is_drop_target) {
- delegate_->UpdateDragCursor(is_drop_target);
+ RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
+ if (view)
+ view->UpdateDragCursor(is_drop_target);
}
void RenderViewHost::OnTakeFocus(bool reverse) {
- delegate_->TakeFocus(reverse);
+ RenderViewHostDelegate::View* view = delegate_->GetViewDelegate();
+ if (view)
+ view->TakeFocus(reverse);
}
void RenderViewHost::OnMsgPageHasOSDD(int32 page_id, const GURL& doc_url,
@@ -1106,10 +1116,17 @@
}
void RenderViewHost::UnhandledInputEvent(const WebInputEvent& event) {
- if ((event.type == WebInputEvent::KEY_DOWN) ||
- (event.type == WebInputEvent::CHAR))
- delegate_->HandleKeyboardEvent(
- static_cast<const WebKeyboardEvent&>(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::KEY_DOWN) ||
+ (event.type == WebInputEvent::CHAR)) {
+ view->HandleKeyboardEvent(
+ static_cast<const WebKeyboardEvent&>(event));
+ }
+ }
}
void RenderViewHost::ForwardKeyboardEvent(const WebKeyboardEvent& key_event) {
« no previous file with comments | « no previous file | chrome/browser/render_view_host_delegate.h » ('j') | chrome/browser/web_contents.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698