OLD | NEW |
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 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ |
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ |
7 | 7 |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/renderer/render_process_observer.h" | 10 #include "content/public/renderer/render_process_observer.h" |
11 #include "ipc/ipc_sender.h" | 11 #include "ipc/ipc_sender.h" |
12 | 12 |
| 13 class GURL; |
| 14 |
13 namespace blink { | 15 namespace blink { |
14 class WebFrame; | 16 class WebFrame; |
15 } | 17 } |
16 | 18 |
17 namespace content { | 19 namespace content { |
18 | 20 |
19 class BrowserPlugin; | 21 class BrowserPlugin; |
20 class BrowserPluginDelegate; | 22 class BrowserPluginDelegate; |
21 class RenderFrame; | 23 class RenderFrame; |
22 | 24 |
23 // BrowserPluginManager manages the routing of messages to the appropriate | 25 // BrowserPluginManager manages the routing of messages to the appropriate |
24 // BrowserPlugin object based on its instance ID. There is one BrowserPlugin | 26 // BrowserPlugin object based on its instance ID. There is one BrowserPlugin |
25 // for the RenderThread. | 27 // for the RenderThread. |
26 class CONTENT_EXPORT BrowserPluginManager : public RenderProcessObserver { | 28 class CONTENT_EXPORT BrowserPluginManager : public RenderProcessObserver { |
27 public: | 29 public: |
28 static BrowserPluginManager* Get(); | 30 static BrowserPluginManager* Get(); |
29 | 31 |
30 BrowserPluginManager(); | 32 BrowserPluginManager(); |
31 ~BrowserPluginManager() override; | 33 ~BrowserPluginManager() override; |
32 | 34 |
33 // Creates a new BrowserPlugin object. | 35 // Creates a new BrowserPlugin object. |
34 // BrowserPlugin is responsible for associating itself with the | 36 // BrowserPlugin is responsible for associating itself with the |
35 // BrowserPluginManager via AddBrowserPlugin. When it is destroyed, it is | 37 // BrowserPluginManager via AddBrowserPlugin. When it is destroyed, it is |
36 // responsible for removing its association via RemoveBrowserPlugin. | 38 // responsible for removing its association via RemoveBrowserPlugin. |
37 BrowserPlugin* CreateBrowserPlugin( | 39 BrowserPlugin* CreateBrowserPlugin(RenderFrame* render_frame, |
38 RenderFrame* render_frame, | 40 const std::string& mime_type, |
39 scoped_ptr<BrowserPluginDelegate> delegate); | 41 const GURL& original_url); |
40 | 42 |
41 void Attach(int browser_plugin_instance_id); | 43 void Attach(int browser_plugin_instance_id); |
42 | 44 |
43 void Detach(int browser_plugin_instance_id); | 45 void Detach(int browser_plugin_instance_id); |
44 | 46 |
45 void AddBrowserPlugin(int browser_plugin_instance_id, | 47 void AddBrowserPlugin(int browser_plugin_instance_id, |
46 BrowserPlugin* browser_plugin); | 48 BrowserPlugin* browser_plugin); |
47 void RemoveBrowserPlugin(int browser_plugin_instance_id); | 49 void RemoveBrowserPlugin(int browser_plugin_instance_id); |
48 BrowserPlugin* GetBrowserPlugin(int browser_plugin_instance_id) const; | 50 BrowserPlugin* GetBrowserPlugin(int browser_plugin_instance_id) const; |
49 | 51 |
(...skipping 15 matching lines...) Expand all Loading... |
65 | 67 |
66 // This map is keyed by guest instance IDs. | 68 // This map is keyed by guest instance IDs. |
67 IDMap<BrowserPlugin> instances_; | 69 IDMap<BrowserPlugin> instances_; |
68 | 70 |
69 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager); | 71 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager); |
70 }; | 72 }; |
71 | 73 |
72 } // namespace content | 74 } // namespace content |
73 | 75 |
74 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ | 76 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ |
OLD | NEW |