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 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/threading/thread_local.h" | 9 #include "base/threading/thread_local.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "content/common/browser_plugin/browser_plugin_constants.h" | 11 #include "content/common/browser_plugin/browser_plugin_constants.h" |
12 #include "content/public/renderer/render_thread.h" | 12 #include "content/public/renderer/render_thread.h" |
13 #include "content/renderer/browser_plugin/browser_plugin.h" | 13 #include "content/renderer/browser_plugin/browser_plugin.h" |
14 #include "content/renderer/browser_plugin/browser_plugin_manager_factory.h" | 14 #include "content/renderer/browser_plugin/browser_plugin_manager_factory.h" |
15 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" | 15 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 // static | 19 // static |
20 BrowserPluginManagerFactory* BrowserPluginManager::factory_ = NULL; | 20 BrowserPluginManagerFactory* BrowserPluginManager::factory_ = NULL; |
21 | 21 |
| 22 // static |
22 BrowserPluginManager* BrowserPluginManager::Create( | 23 BrowserPluginManager* BrowserPluginManager::Create( |
23 RenderViewImpl* render_view) { | 24 RenderViewImpl* render_view) { |
24 if (factory_) | 25 if (factory_) |
25 return factory_->CreateBrowserPluginManager(render_view); | 26 return factory_->CreateBrowserPluginManager(render_view); |
26 return new BrowserPluginManagerImpl(render_view); | 27 return new BrowserPluginManagerImpl(render_view); |
27 } | 28 } |
28 | 29 |
29 BrowserPluginManager::BrowserPluginManager(RenderViewImpl* render_view) | 30 BrowserPluginManager::BrowserPluginManager(RenderViewImpl* render_view) |
30 : RenderViewObserver(render_view), | 31 : RenderViewObserver(render_view), |
31 current_instance_id_(browser_plugin::kInstanceIDNone), | 32 current_instance_id_(browser_plugin::kInstanceIDNone), |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 71 } |
71 } | 72 } |
72 | 73 |
73 void BrowserPluginManager::Attach(int browser_plugin_instance_id) { | 74 void BrowserPluginManager::Attach(int browser_plugin_instance_id) { |
74 BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id); | 75 BrowserPlugin* plugin = GetBrowserPlugin(browser_plugin_instance_id); |
75 if (plugin) | 76 if (plugin) |
76 plugin->Attach(); | 77 plugin->Attach(); |
77 } | 78 } |
78 | 79 |
79 } // namespace content | 80 } // namespace content |
OLD | NEW |