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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest_helper.cc

Issue 11088043: browser-plugin: Allow accepting drag-n-drop events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest_helper.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h"
6 6
7 #include "content/browser/browser_plugin/browser_plugin_guest.h" 7 #include "content/browser/browser_plugin/browser_plugin_guest.h"
8 #include "content/browser/web_contents/web_contents_impl.h" 8 #include "content/browser/web_contents/web_contents_impl.h"
9 #include "content/common/drag_messages.h"
9 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
10 #include "content/public/browser/render_view_host.h" 11 #include "content/public/browser/render_view_host.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 BrowserPluginGuestHelper::BrowserPluginGuestHelper( 15 BrowserPluginGuestHelper::BrowserPluginGuestHelper(
15 BrowserPluginGuest* guest, 16 BrowserPluginGuest* guest,
16 RenderViewHost* render_view_host) 17 RenderViewHost* render_view_host)
17 : RenderViewHostObserver(render_view_host), 18 : RenderViewHostObserver(render_view_host),
18 guest_(guest) { 19 guest_(guest) {
19 } 20 }
20 21
21 BrowserPluginGuestHelper::~BrowserPluginGuestHelper() { 22 BrowserPluginGuestHelper::~BrowserPluginGuestHelper() {
22 } 23 }
23 24
24 bool BrowserPluginGuestHelper::OnMessageReceived( 25 bool BrowserPluginGuestHelper::OnMessageReceived(
25 const IPC::Message& message) { 26 const IPC::Message& message) {
26 bool handled = true; 27 bool handled = true;
27 IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuestHelper, message) 28 IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuestHelper, message)
29 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
28 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) 30 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
29 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnHandleInputEventAck) 31 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnHandleInputEventAck)
30 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) 32 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
31 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) 33 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget)
32 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, 34 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers,
33 OnMsgHasTouchEventHandlers) 35 OnMsgHasTouchEventHandlers)
34 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) 36 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
35 IPC_MESSAGE_UNHANDLED(handled = false) 37 IPC_MESSAGE_UNHANDLED(handled = false)
36 IPC_END_MESSAGE_MAP() 38 IPC_END_MESSAGE_MAP()
37 return handled; 39 return handled;
38 } 40 }
39 41
42 void BrowserPluginGuestHelper::OnUpdateDragCursor(
43 WebKit::WebDragOperation current_op) {
44 guest_->UpdateDragCursor(current_op);
45 }
46
40 void BrowserPluginGuestHelper::OnUpdateRect( 47 void BrowserPluginGuestHelper::OnUpdateRect(
41 const ViewHostMsg_UpdateRect_Params& params) { 48 const ViewHostMsg_UpdateRect_Params& params) {
42 guest_->UpdateRect(render_view_host(), params); 49 guest_->UpdateRect(render_view_host(), params);
43 } 50 }
44 51
45 void BrowserPluginGuestHelper::OnHandleInputEventAck( 52 void BrowserPluginGuestHelper::OnHandleInputEventAck(
46 WebKit::WebInputEvent::Type event_type, 53 WebKit::WebInputEvent::Type event_type,
47 bool processed) { 54 bool processed) {
48 guest_->HandleInputEventAck(render_view_host(), processed); 55 guest_->HandleInputEventAck(render_view_host(), processed);
49 } 56 }
50 57
51 void BrowserPluginGuestHelper::OnTakeFocus(bool reverse) { 58 void BrowserPluginGuestHelper::OnTakeFocus(bool reverse) {
52 guest_->ViewTakeFocus(reverse); 59 guest_->ViewTakeFocus(reverse);
53 } 60 }
54 61
55 void BrowserPluginGuestHelper::OnShowWidget(int route_id, 62 void BrowserPluginGuestHelper::OnShowWidget(int route_id,
56 const gfx::Rect& initial_pos) { 63 const gfx::Rect& initial_pos) {
57 guest_->ShowWidget(render_view_host(), route_id, initial_pos); 64 guest_->ShowWidget(render_view_host(), route_id, initial_pos);
58 } 65 }
59 66
60 void BrowserPluginGuestHelper::OnMsgHasTouchEventHandlers(bool has_handlers) { 67 void BrowserPluginGuestHelper::OnMsgHasTouchEventHandlers(bool has_handlers) {
61 guest_->SetIsAcceptingTouchEvents(has_handlers); 68 guest_->SetIsAcceptingTouchEvents(has_handlers);
62 } 69 }
63 70
64 void BrowserPluginGuestHelper::OnSetCursor(const WebCursor& cursor) { 71 void BrowserPluginGuestHelper::OnSetCursor(const WebCursor& cursor) {
65 guest_->SetCursor(cursor); 72 guest_->SetCursor(cursor);
66 } 73 }
67 74
68 } // namespace content 75 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698