OLD | NEW |
(Empty) | |
| 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_H_ |
| 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ |
| 7 |
| 8 #include "base/id_map.h" |
| 9 #include "content/public/renderer/render_process_observer.h" |
| 10 #include "ipc/ipc_sender.h" |
| 11 |
| 12 class RenderViewImpl; |
| 13 |
| 14 namespace WebKit { |
| 15 class WebFrame; |
| 16 struct WebPluginParams; |
| 17 } |
| 18 |
| 19 namespace content { |
| 20 namespace browser_plugin { |
| 21 |
| 22 class BrowserPlugin; |
| 23 |
| 24 // BrowserPluginManager manages the routing of messages to the appropriate |
| 25 // BrowserPlugin object based on its instance ID. There is only one |
| 26 // BrowserPluginManager per renderer process, and it should only be accessed |
| 27 // by the render thread. |
| 28 class CONTENT_EXPORT BrowserPluginManager : public IPC::Sender, |
| 29 public RenderProcessObserver { |
| 30 public: |
| 31 // Returns the one BrowserPluginManager for this process. |
| 32 static BrowserPluginManager* Get(); |
| 33 |
| 34 BrowserPluginManager(); |
| 35 virtual ~BrowserPluginManager(); |
| 36 |
| 37 virtual BrowserPlugin* CreateBrowserPlugin( |
| 38 RenderViewImpl* render_view, |
| 39 WebKit::WebFrame* frame, |
| 40 const WebKit::WebPluginParams& params) = 0; |
| 41 |
| 42 void AddBrowserPlugin(int instance_id, BrowserPlugin* browser_plugin); |
| 43 void RemoveBrowserPlugin(int instance_id); |
| 44 BrowserPlugin* GetBrowserPlugin(int instance_id) const; |
| 45 |
| 46 protected: |
| 47 IDMap<BrowserPlugin> instances_; |
| 48 int browser_plugin_counter_; |
| 49 }; |
| 50 |
| 51 } // namespace browser_plugin |
| 52 } // namespace content |
| 53 |
| 54 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ |
OLD | NEW |