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 RenderViewImpl* render_view) | 13 RenderViewImpl* render_view) |
14 : BrowserPluginManager(render_view) { | 14 : BrowserPluginManager(render_view) { |
15 } | 15 } |
16 | 16 |
17 MockBrowserPluginManager::~MockBrowserPluginManager() { | 17 MockBrowserPluginManager::~MockBrowserPluginManager() { |
18 } | 18 } |
19 | 19 |
20 BrowserPlugin* MockBrowserPluginManager::CreateBrowserPlugin( | 20 BrowserPlugin* MockBrowserPluginManager::CreateBrowserPlugin( |
21 RenderViewImpl* render_view, | 21 RenderViewImpl* render_view, |
22 WebKit::WebFrame* frame, | 22 WebKit::WebFrame* frame, |
23 const WebKit::WebPluginParams& params) { | 23 const WebKit::WebPluginParams& params) { |
24 return new MockBrowserPlugin(browser_plugin_counter_++, | 24 return new MockBrowserPlugin(++browser_plugin_counter_, |
25 render_view, | 25 render_view, |
26 frame, | 26 frame, |
27 params); | 27 params); |
28 } | 28 } |
29 | 29 |
30 void MockBrowserPluginManager::Cleanup() { | 30 void MockBrowserPluginManager::Cleanup() { |
31 IDMap<BrowserPlugin>::iterator iter(&instances_); | 31 IDMap<BrowserPlugin>::iterator iter(&instances_); |
32 while (!iter.IsAtEnd()) { | 32 while (!iter.IsAtEnd()) { |
33 iter.GetCurrentValue()->Cleanup(); | 33 iter.GetCurrentValue()->Cleanup(); |
34 iter.Advance(); | 34 iter.Advance(); |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
(...skipping 21 matching lines...) Expand all Loading... |
59 } | 59 } |
60 | 60 |
61 bool MockBrowserPluginManager::OnMessageReceived( | 61 bool MockBrowserPluginManager::OnMessageReceived( |
62 const IPC::Message& message) { | 62 const IPC::Message& message) { |
63 // Save the message in the sink. | 63 // Save the message in the sink. |
64 sink_.OnMessageReceived(message); | 64 sink_.OnMessageReceived(message); |
65 return false; | 65 return false; |
66 } | 66 } |
67 | 67 |
68 } // namespace content | 68 } // namespace content |
OLD | NEW |