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 20 matching lines...) Expand all Loading... |
31 public: | 31 public: |
32 // Returns the one BrowserPluginManager for this process. | 32 // Returns the one BrowserPluginManager for this process. |
33 static BrowserPluginManager* Create(RenderViewImpl* render_view); | 33 static BrowserPluginManager* Create(RenderViewImpl* render_view); |
34 | 34 |
35 // Overrides factory for testing. Default (NULL) value indicates regular | 35 // Overrides factory for testing. Default (NULL) value indicates regular |
36 // (non-test) environment. | 36 // (non-test) environment. |
37 static void set_factory_for_testing(BrowserPluginManagerFactory* factory) { | 37 static void set_factory_for_testing(BrowserPluginManagerFactory* factory) { |
38 BrowserPluginManager::factory_ = factory; | 38 BrowserPluginManager::factory_ = factory; |
39 } | 39 } |
40 | 40 |
41 BrowserPluginManager(RenderViewImpl* render_view); | 41 explicit BrowserPluginManager(RenderViewImpl* render_view); |
42 | 42 |
43 // Creates a new BrowserPlugin object with a unique identifier. | 43 // Creates a new BrowserPlugin object with a unique identifier. |
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 WebKit::WebFrame* frame, |
50 const WebKit::WebPluginParams& params) = 0; | 50 const WebKit::WebPluginParams& params) = 0; |
51 | 51 |
(...skipping 23 matching lines...) Expand all Loading... |
75 | 75 |
76 virtual ~BrowserPluginManager(); | 76 virtual ~BrowserPluginManager(); |
77 IDMap<BrowserPlugin> instances_; | 77 IDMap<BrowserPlugin> instances_; |
78 base::WeakPtr<RenderViewImpl> render_view_; | 78 base::WeakPtr<RenderViewImpl> render_view_; |
79 int browser_plugin_counter_; | 79 int browser_plugin_counter_; |
80 }; | 80 }; |
81 | 81 |
82 } // namespace content | 82 } // namespace content |
83 | 83 |
84 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ | 84 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_H_ |
OLD | NEW |