| 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/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "content/public/renderer/render_view_observer.h" | 12 #include "content/public/renderer/render_view_observer.h" |
| 13 #include "ipc/ipc_sender.h" | 13 #include "ipc/ipc_sender.h" |
| 14 | 14 |
| 15 namespace WebKit { | 15 namespace blink { |
| 16 class WebFrame; | 16 class WebFrame; |
| 17 struct WebPluginParams; | 17 struct WebPluginParams; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 class BrowserPlugin; | 22 class BrowserPlugin; |
| 23 class BrowserPluginManagerFactory; | 23 class BrowserPluginManagerFactory; |
| 24 class RenderViewImpl; | 24 class RenderViewImpl; |
| 25 | 25 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 explicit BrowserPluginManager(RenderViewImpl* render_view); | 41 explicit BrowserPluginManager(RenderViewImpl* render_view); |
| 42 | 42 |
| 43 // Creates a new BrowserPlugin object. | 43 // Creates a new BrowserPlugin object. |
| 44 // BrowserPlugin is responsible for associating itself with the | 44 // BrowserPlugin is responsible for associating itself with the |
| 45 // BrowserPluginManager via AddBrowserPlugin. When it is destroyed, it is | 45 // BrowserPluginManager via AddBrowserPlugin. When it is destroyed, it is |
| 46 // responsible for removing its association via RemoveBrowserPlugin. | 46 // responsible for removing its association via RemoveBrowserPlugin. |
| 47 virtual BrowserPlugin* CreateBrowserPlugin( | 47 virtual BrowserPlugin* CreateBrowserPlugin( |
| 48 RenderViewImpl* render_view, | 48 RenderViewImpl* render_view, |
| 49 WebKit::WebFrame* frame, | 49 blink::WebFrame* frame, |
| 50 const WebKit::WebPluginParams& params) = 0; | 50 const blink::WebPluginParams& params) = 0; |
| 51 | 51 |
| 52 // Asynchronously requests a new browser-process-allocated instance ID. | 52 // Asynchronously requests a new browser-process-allocated instance ID. |
| 53 // After the browser process allocates an ID, it calls back into the | 53 // After the browser process allocates an ID, it calls back into the |
| 54 // |browser_plugin| if it's still alive. | 54 // |browser_plugin| if it's still alive. |
| 55 virtual void AllocateInstanceID( | 55 virtual void AllocateInstanceID( |
| 56 const base::WeakPtr<BrowserPlugin>& browser_plugin) = 0; | 56 const base::WeakPtr<BrowserPlugin>& browser_plugin) = 0; |
| 57 | 57 |
| 58 void AddBrowserPlugin(int guest_instance_id, BrowserPlugin* browser_plugin); | 58 void AddBrowserPlugin(int guest_instance_id, BrowserPlugin* browser_plugin); |
| 59 void RemoveBrowserPlugin(int guest_instance_id); | 59 void RemoveBrowserPlugin(int guest_instance_id); |
| 60 BrowserPlugin* GetBrowserPlugin(int guest_instance_id) const; | 60 BrowserPlugin* GetBrowserPlugin(int guest_instance_id) const; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 84 // This map is keyed by guest instance IDs. | 84 // This map is keyed by guest instance IDs. |
| 85 IDMap<BrowserPlugin> instances_; | 85 IDMap<BrowserPlugin> instances_; |
| 86 base::WeakPtr<RenderViewImpl> render_view_; | 86 base::WeakPtr<RenderViewImpl> render_view_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager); | 88 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace content | 91 } // namespace content |
| 92 | 92 |
| 93 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ | 93 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ |
| OLD | NEW |