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
3 // found in the LICENSE file.
5 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h"
7 #include "content/browser/browser_plugin/browser_plugin_guest.h"
8 #include "content/common/drag_messages.h"
9 #include "content/common/view_messages.h"
10 #include "content/public/browser/render_view_host.h"
14 BrowserPluginGuestHelper::BrowserPluginGuestHelper(
15 BrowserPluginGuest
* guest
,
16 RenderViewHost
* render_view_host
)
17 : RenderViewHostObserver(render_view_host
),
21 BrowserPluginGuestHelper::~BrowserPluginGuestHelper() {
24 bool BrowserPluginGuestHelper::OnMessageReceived(
25 const IPC::Message
& message
) {
26 if (ShouldForwardToBrowserPluginGuest(message
))
27 return guest_
->OnMessageReceived(message
);
32 bool BrowserPluginGuestHelper::ShouldForwardToBrowserPluginGuest(
33 const IPC::Message
& message
) {
34 switch (message
.type()) {
35 case DragHostMsg_UpdateDragCursor::ID
:
36 case ViewHostMsg_HandleInputEvent_ACK::ID
:
37 case ViewHostMsg_HasTouchEventHandlers::ID
:
38 case ViewHostMsg_SetCursor::ID
:
39 #if defined(OS_MACOSX)
40 case ViewHostMsg_ShowPopup::ID
:
42 case ViewHostMsg_ShowWidget::ID
:
43 case ViewHostMsg_TakeFocus::ID
:
44 case ViewHostMsg_UpdateFrameName::ID
:
45 case ViewHostMsg_UpdateRect::ID
:
53 } // namespace content