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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 RenderViewImpl* render_view, | 48 RenderViewImpl* render_view, |
49 WebKit::WebFrame* frame, | 49 WebKit::WebFrame* frame, |
50 const WebKit::WebPluginParams& params) = 0; | 50 const WebKit::WebPluginParams& params) = 0; |
51 virtual void AllocateInstanceID(BrowserPlugin* browser_plugin) = 0; | 51 virtual void AllocateInstanceID(BrowserPlugin* browser_plugin) = 0; |
52 | 52 |
53 void AddBrowserPlugin(int guest_instance_id, BrowserPlugin* browser_plugin); | 53 void AddBrowserPlugin(int guest_instance_id, BrowserPlugin* browser_plugin); |
54 void RemoveBrowserPlugin(int guest_instance_id); | 54 void RemoveBrowserPlugin(int guest_instance_id); |
55 BrowserPlugin* GetBrowserPlugin(int guest_instance_id) const; | 55 BrowserPlugin* GetBrowserPlugin(int guest_instance_id) const; |
56 void UpdateDeviceScaleFactor(float device_scale_factor); | 56 void UpdateDeviceScaleFactor(float device_scale_factor); |
57 void UpdateFocusState(); | 57 void UpdateFocusState(); |
58 RenderViewImpl* render_view() const { return render_view_; } | 58 RenderViewImpl* render_view() const { return render_view_.get(); } |
59 | 59 |
60 // RenderViewObserver implementation. | 60 // RenderViewObserver implementation. |
61 | 61 |
62 // BrowserPluginManager must override the default Send behavior. | 62 // BrowserPluginManager must override the default Send behavior. |
63 virtual bool Send(IPC::Message* msg) OVERRIDE = 0; | 63 virtual bool Send(IPC::Message* msg) OVERRIDE = 0; |
64 | 64 |
65 // Don't destroy the BrowserPluginManager when the RenderViewImpl goes away. | 65 // Don't destroy the BrowserPluginManager when the RenderViewImpl goes away. |
66 // BrowserPluginManager's lifetime is managed by a reference count. Once | 66 // BrowserPluginManager's lifetime is managed by a reference count. Once |
67 // the host RenderViewImpl and all BrowserPlugins release their references, | 67 // the host RenderViewImpl and all BrowserPlugins release their references, |
68 // then the BrowserPluginManager will be destroyed. | 68 // then the BrowserPluginManager will be destroyed. |
(...skipping 10 matching lines...) Expand all Loading... |
79 // This map is keyed by guest instance IDs. | 79 // This map is keyed by guest instance IDs. |
80 IDMap<BrowserPlugin> instances_; | 80 IDMap<BrowserPlugin> instances_; |
81 base::WeakPtr<RenderViewImpl> render_view_; | 81 base::WeakPtr<RenderViewImpl> render_view_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager); | 83 DISALLOW_COPY_AND_ASSIGN(BrowserPluginManager); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace content | 86 } // namespace content |
87 | 87 |
88 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ | 88 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ |
OLD | NEW |