| 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_BROWSER_PLUGIN_MANAGER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_IMPL_H_ |
| 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_IMPL_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_MANAGER_IMPL_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(); | 18 MockBrowserPluginManager(); |
| 19 virtual ~MockBrowserPluginManager(); | 19 virtual ~MockBrowserPluginManager(); |
| 20 | 20 |
| 21 // BrowserPluginManager implementation. | 21 // BrowserPluginManager implementation. |
| 22 virtual BrowserPlugin* CreateBrowserPlugin( | 22 virtual BrowserPlugin* CreateBrowserPlugin( |
| 23 RenderViewImpl* render_view, | 23 RenderViewImpl* render_view, |
| 24 WebKit::WebFrame* frame, | 24 WebKit::WebFrame* frame, |
| 25 const WebKit::WebPluginParams& params) OVERRIDE; | 25 const WebKit::WebPluginParams& params) OVERRIDE; |
| 26 virtual void SignalTextureProviderIsReady(int instance_id) OVERRIDE; |
| 26 | 27 |
| 27 // Iterate over all BrowserPlugins and tell them to cleanup after themselves | 28 // Iterate over all BrowserPlugins and tell them to cleanup after themselves |
| 28 // before we blow away the MockRenderProcess. | 29 // before we blow away the MockRenderProcess. |
| 29 void Cleanup(); | 30 void Cleanup(); |
| 30 | 31 |
| 31 // Provides access to the messages that have been received by this thread. | 32 // Provides access to the messages that have been received by this thread. |
| 32 IPC::TestSink& sink() { return sink_; } | 33 IPC::TestSink& sink() { return sink_; } |
| 33 | 34 |
| 34 // IPC::Sender implementation. | 35 // IPC::Sender implementation. |
| 35 virtual bool Send(IPC::Message* msg) OVERRIDE; | 36 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 36 | 37 |
| 37 // RenderProcessObserver override. | 38 // RenderProcessObserver override. |
| 38 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 39 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| 39 private: | 40 private: |
| 40 IPC::TestSink sink_; | 41 IPC::TestSink sink_; |
| 41 | 42 |
| 42 // The last known good deserializer for sync messages. | 43 // The last known good deserializer for sync messages. |
| 43 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; | 44 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; |
| 44 | 45 |
| 45 DISALLOW_COPY_AND_ASSIGN(MockBrowserPluginManager); | 46 DISALLOW_COPY_AND_ASSIGN(MockBrowserPluginManager); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace content | 49 } // namespace content |
| 49 | 50 |
| 50 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_TESTS_BROWSER_PLUGIN_MANAGER_IMPL_H_ | 51 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_TESTS_BROWSER_PLUGIN_MANAGER_IMPL_H_ |
| OLD | NEW |