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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "content/common/browser_plugin/browser_plugin_constants.h" | 8 #include "content/common/browser_plugin/browser_plugin_constants.h" |
9 #include "content/common/browser_plugin/browser_plugin_messages.h" | 9 #include "content/common/browser_plugin/browser_plugin_messages.h" |
10 #include "content/common/frame_messages.h" | 10 #include "content/common/frame_messages.h" |
11 #include "content/public/renderer/browser_plugin_delegate.h" | 11 #include "content/public/renderer/browser_plugin_delegate.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 "ipc/ipc_message_macros.h" | 14 #include "ipc/ipc_message_macros.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 // static | 18 // static |
19 int BrowserPluginManager::current_instance_id_ = | |
20 browser_plugin::kInstanceIDNone; | |
21 | |
22 // static | |
23 BrowserPluginManager* BrowserPluginManager::Create( | 19 BrowserPluginManager* BrowserPluginManager::Create( |
24 RenderViewImpl* render_view) { | 20 RenderViewImpl* render_view) { |
25 return new BrowserPluginManager(render_view); | 21 return new BrowserPluginManager(render_view); |
26 } | 22 } |
27 | 23 |
28 BrowserPluginManager::BrowserPluginManager(RenderViewImpl* render_view) | 24 BrowserPluginManager::BrowserPluginManager(RenderViewImpl* render_view) |
29 : RenderViewObserver(render_view), | 25 : RenderViewObserver(render_view), |
| 26 current_instance_id_(browser_plugin::kInstanceIDNone), |
30 render_view_(render_view->AsWeakPtr()) { | 27 render_view_(render_view->AsWeakPtr()) { |
31 } | 28 } |
32 | 29 |
33 BrowserPluginManager::~BrowserPluginManager() { | 30 BrowserPluginManager::~BrowserPluginManager() { |
34 } | 31 } |
35 | 32 |
36 void BrowserPluginManager::AddBrowserPlugin( | 33 void BrowserPluginManager::AddBrowserPlugin( |
37 int browser_plugin_instance_id, | 34 int browser_plugin_instance_id, |
38 BrowserPlugin* browser_plugin) { | 35 BrowserPlugin* browser_plugin) { |
39 instances_.AddWithID(browser_plugin, browser_plugin_instance_id); | 36 instances_.AddWithID(browser_plugin, browser_plugin_instance_id); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 123 |
127 FrameHostMsg_CompositorFrameSwappedACK_Params params; | 124 FrameHostMsg_CompositorFrameSwappedACK_Params params; |
128 params.producing_host_id = param.b.producing_host_id; | 125 params.producing_host_id = param.b.producing_host_id; |
129 params.producing_route_id = param.b.producing_route_id; | 126 params.producing_route_id = param.b.producing_route_id; |
130 params.output_surface_id = param.b.output_surface_id; | 127 params.output_surface_id = param.b.output_surface_id; |
131 Send(new BrowserPluginHostMsg_CompositorFrameSwappedACK( | 128 Send(new BrowserPluginHostMsg_CompositorFrameSwappedACK( |
132 routing_id(), param.a, params)); | 129 routing_id(), param.a, params)); |
133 } | 130 } |
134 | 131 |
135 } // namespace content | 132 } // namespace content |
OLD | NEW |