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_MOCK_BROWSER_PLUGIN_MANAGER_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_ |
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_ |
7 | 7 |
8 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 8 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "ipc/ipc_message_utils.h" | 11 #include "ipc/ipc_message_utils.h" |
12 #include "ipc/ipc_test_sink.h" | 12 #include "ipc/ipc_test_sink.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 class MockBrowserPluginManager : public BrowserPluginManager { | 16 class MockBrowserPluginManager : public BrowserPluginManager { |
17 public: | 17 public: |
18 MockBrowserPluginManager(RenderViewImpl* render_view); | 18 MockBrowserPluginManager(RenderViewImpl* render_view); |
19 | 19 |
20 // BrowserPluginManager implementation. | 20 // BrowserPluginManager implementation. |
21 virtual BrowserPlugin* CreateBrowserPlugin( | 21 virtual BrowserPlugin* CreateBrowserPlugin( |
22 RenderViewImpl* render_view, | 22 RenderViewImpl* render_view, |
23 WebKit::WebFrame* frame, | 23 WebKit::WebFrame* frame, |
24 const WebKit::WebPluginParams& params) OVERRIDE; | 24 const WebKit::WebPluginParams& params) OVERRIDE; |
| 25 virtual void AllocateInstanceID(BrowserPlugin* browser_plugin) OVERRIDE; |
25 | 26 |
26 // Provides access to the messages that have been received by this thread. | 27 // Provides access to the messages that have been received by this thread. |
27 IPC::TestSink& sink() { return sink_; } | 28 IPC::TestSink& sink() { return sink_; } |
28 | 29 |
29 // RenderViewObserver override. | 30 // RenderViewObserver override. |
30 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 31 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
31 virtual bool Send(IPC::Message* msg) OVERRIDE; | 32 virtual bool Send(IPC::Message* msg) OVERRIDE; |
32 protected: | 33 protected: |
33 virtual ~MockBrowserPluginManager(); | 34 virtual ~MockBrowserPluginManager(); |
| 35 void AllocateInstanceIDResponse(BrowserPlugin* browser_plugin, |
| 36 int instance_id); |
| 37 |
34 IPC::TestSink sink_; | 38 IPC::TestSink sink_; |
35 | 39 |
36 // The last known good deserializer for sync messages. | 40 // The last known good deserializer for sync messages. |
37 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; | 41 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; |
38 | 42 |
| 43 int browser_plugin_counter_; |
| 44 |
39 DISALLOW_COPY_AND_ASSIGN(MockBrowserPluginManager); | 45 DISALLOW_COPY_AND_ASSIGN(MockBrowserPluginManager); |
40 }; | 46 }; |
41 | 47 |
42 } // namespace content | 48 } // namespace content |
43 | 49 |
44 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_ | 50 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_ |
OLD | NEW |