| 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/mock_browser_plugin_manager.h" | 5 #include "content/renderer/browser_plugin/mock_browser_plugin_manager.h" |
| 6 | 6 |
| 7 #include "ipc/ipc_message.h" | 7 #include "ipc/ipc_message.h" |
| 8 #include "content/renderer/browser_plugin/mock_browser_plugin.h" | 8 #include "content/renderer/browser_plugin/mock_browser_plugin.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 MockBrowserPluginManager::MockBrowserPluginManager() { | 12 MockBrowserPluginManager::MockBrowserPluginManager() { |
| 13 } | 13 } |
| 14 | 14 |
| 15 MockBrowserPluginManager::~MockBrowserPluginManager() { | 15 MockBrowserPluginManager::~MockBrowserPluginManager() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 BrowserPlugin* MockBrowserPluginManager::CreateBrowserPlugin( | 18 BrowserPlugin* MockBrowserPluginManager::CreateBrowserPlugin( |
| 19 RenderViewImpl* render_view, | 19 RenderViewImpl* render_view, |
| 20 WebKit::WebFrame* frame, | 20 WebKit::WebFrame* frame, |
| 21 const WebKit::WebPluginParams& params) { | 21 const WebKit::WebPluginParams& params) { |
| 22 return new MockBrowserPlugin(browser_plugin_counter_++, | 22 return new MockBrowserPlugin(browser_plugin_counter_++, |
| 23 render_view, | 23 render_view, |
| 24 frame, | 24 frame, |
| 25 params); | 25 params); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void MockBrowserPluginManager::SignalTextureProviderIsReady(int instance_id) { |
| 29 } |
| 30 |
| 28 void MockBrowserPluginManager::Cleanup() { | 31 void MockBrowserPluginManager::Cleanup() { |
| 29 IDMap<BrowserPlugin>::iterator iter(&instances_); | 32 IDMap<BrowserPlugin>::iterator iter(&instances_); |
| 30 while (!iter.IsAtEnd()) { | 33 while (!iter.IsAtEnd()) { |
| 31 iter.GetCurrentValue()->Cleanup(); | 34 iter.GetCurrentValue()->Cleanup(); |
| 32 iter.Advance(); | 35 iter.Advance(); |
| 33 } | 36 } |
| 34 } | 37 } |
| 35 | 38 |
| 36 bool MockBrowserPluginManager::Send(IPC::Message* msg) { | 39 bool MockBrowserPluginManager::Send(IPC::Message* msg) { |
| 37 // This is a copy-and-paste from MockRenderThread::Send. | 40 // This is a copy-and-paste from MockRenderThread::Send. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 57 } | 60 } |
| 58 | 61 |
| 59 bool MockBrowserPluginManager::OnControlMessageReceived( | 62 bool MockBrowserPluginManager::OnControlMessageReceived( |
| 60 const IPC::Message& message) { | 63 const IPC::Message& message) { |
| 61 // Save the message in the sink. | 64 // Save the message in the sink. |
| 62 sink_.OnMessageReceived(message); | 65 sink_.OnMessageReceived(message); |
| 63 return false; | 66 return false; |
| 64 } | 67 } |
| 65 | 68 |
| 66 } // namespace content | 69 } // namespace content |
| OLD | NEW |