By moving the call to Load() up in SearchProvider::Start(), we are giving a chance...
[chromium-blink-merge.git] / content / browser / browser_plugin / browser_plugin_guest_helper.cc
blob5a9d6e04614d441a8f0da51954b33f4f58000aa9
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"
12 namespace content {
14 BrowserPluginGuestHelper::BrowserPluginGuestHelper(
15 BrowserPluginGuest* guest,
16 RenderViewHost* render_view_host)
17 : RenderViewHostObserver(render_view_host),
18 guest_(guest) {
21 BrowserPluginGuestHelper::~BrowserPluginGuestHelper() {
24 bool BrowserPluginGuestHelper::OnMessageReceived(
25 const IPC::Message& message) {
26 if (ShouldForwardToBrowserPluginGuest(message))
27 return guest_->OnMessageReceived(message);
28 return false;
31 // static
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:
41 #endif
42 case ViewHostMsg_ShowWidget::ID:
43 case ViewHostMsg_TakeFocus::ID:
44 case ViewHostMsg_UpdateFrameName::ID:
45 case ViewHostMsg_UpdateRect::ID:
46 return true;
47 default:
48 break;
50 return false;
53 } // namespace content