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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 blink::WebFrame* frame, | 49 blink::WebFrame* frame, |
50 bool auto_navigate) = 0; | 50 bool auto_navigate) = 0; |
51 | 51 |
52 // Asynchronously requests a new browser-process-allocated instance ID. | |
53 // After the browser process allocates an ID, it calls back into the | |
54 // |browser_plugin| if it's still alive. | |
55 virtual void AllocateInstanceID( | |
56 const base::WeakPtr<BrowserPlugin>& browser_plugin) = 0; | |
57 | |
58 void AddBrowserPlugin(int guest_instance_id, BrowserPlugin* browser_plugin); | 52 void AddBrowserPlugin(int guest_instance_id, BrowserPlugin* browser_plugin); |
59 void RemoveBrowserPlugin(int guest_instance_id); | 53 void RemoveBrowserPlugin(int guest_instance_id); |
60 BrowserPlugin* GetBrowserPlugin(int guest_instance_id) const; | 54 BrowserPlugin* GetBrowserPlugin(int guest_instance_id) const; |
61 void UpdateDeviceScaleFactor(float device_scale_factor); | 55 void UpdateDeviceScaleFactor(float device_scale_factor); |
62 void UpdateFocusState(); | 56 void UpdateFocusState(); |
63 RenderViewImpl* render_view() const { return render_view_.get(); } | 57 RenderViewImpl* render_view() const { return render_view_.get(); } |
64 | 58 |
65 // RenderViewObserver implementation. | 59 // RenderViewObserver implementation. |
66 | 60 |
67 // BrowserPluginManager must override the default Send behavior. | 61 // BrowserPluginManager must override the default Send behavior. |
(...skipping 16 matching lines...) Expand all Loading... |
84 // This map is keyed by guest instance IDs. | 78 // This map is keyed by guest instance IDs. |
85 IDMap<BrowserPlugin> instances_; | 79 IDMap<BrowserPlugin> instances_; |
86 base::WeakPtr<RenderViewImpl> render_view_; | 80 base::WeakPtr<RenderViewImpl> render_view_; |
87 | 81 |
88 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager); | 82 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager); |
89 }; | 83 }; |
90 | 84 |
91 } // namespace content | 85 } // namespace content |
92 | 86 |
93 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ | 87 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ |
OLD | NEW |