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. 4 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_IMPL_H_ 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_IMPL_H_ 7 8 #include "content/renderer/browser_plugin/browser_plugin_manager.h" 9 #include "ui/gfx/size.h" 10 11 struct BrowserPluginMsg_UpdateRect_Params; 12 class WebCursor; 13 14 namespace gfx { 15 class Point; 16 } 17 18 namespace content { 19 20 class BrowserPluginManagerImpl : public BrowserPluginManager { 21 public: 22 explicit BrowserPluginManagerImpl(RenderViewImpl* render_view); 23 24 // BrowserPluginManager implementation. 25 virtual BrowserPlugin* CreateBrowserPlugin( 26 RenderViewImpl* render_view, 27 WebKit::WebFrame* frame, 28 const WebKit::WebPluginParams& params) OVERRIDE; 29 virtual void AllocateInstanceID(BrowserPlugin* browser_plugin) OVERRIDE; 30 31 // IPC::Sender implementation. 32 virtual bool Send(IPC::Message* msg) OVERRIDE; 33 34 // RenderViewObserver override. Call on render thread. 35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 36 virtual void DidCommitCompositorFrame() OVERRIDE; 37 38 private: 39 virtual ~BrowserPluginManagerImpl(); 40 41 void OnAllocateInstanceIDACK(const IPC::Message& message, 42 int request_id, 43 int guest_instance_id); 44 void OnPluginAtPositionRequest(const IPC::Message& message, 45 int request_id, 46 const gfx::Point& position); 47 48 int request_id_counter_; 49 IDMap<BrowserPlugin> pending_allocate_guest_instance_id_requests_; 50 51 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManagerImpl); 52 }; 53 54 } // namespace content 55 56 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_IMPL_H_ 57