| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // BrowserPluginManager implementation. | 22 // BrowserPluginManager implementation. |
| 23 virtual BrowserPlugin* CreateBrowserPlugin( | 23 virtual BrowserPlugin* CreateBrowserPlugin( |
| 24 RenderViewImpl* render_view, | 24 RenderViewImpl* render_view, |
| 25 blink::WebFrame* frame, | 25 blink::WebFrame* frame, |
| 26 bool auto_navigate) OVERRIDE; | 26 bool auto_navigate) OVERRIDE; |
| 27 | 27 |
| 28 // Provides access to the messages that have been received by this thread. | 28 // Provides access to the messages that have been received by this thread. |
| 29 IPC::TestSink& sink() { return sink_; } | 29 IPC::TestSink& sink() { return sink_; } |
| 30 | 30 |
| 31 // Allocates instance ID for the browser plugin. | |
| 32 void AllocateInstanceID(BrowserPlugin* browser_plugin); | |
| 33 | |
| 34 // RenderViewObserver override. | 31 // RenderViewObserver override. |
| 35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 32 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 36 virtual bool Send(IPC::Message* msg) OVERRIDE; | 33 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 37 | 34 |
| 38 // Returns the latest browser plugin that was created by this manager. | 35 // Returns the latest browser plugin that was created by this manager. |
| 39 MockBrowserPlugin* last_plugin() { return last_plugin_; } | 36 MockBrowserPlugin* last_plugin() { return last_plugin_; } |
| 40 | 37 |
| 41 protected: | 38 protected: |
| 42 virtual ~MockBrowserPluginManager(); | 39 virtual ~MockBrowserPluginManager(); |
| 43 void AllocateInstanceIDACK(BrowserPlugin* browser_plugin, | |
| 44 int guest_instance_id); | |
| 45 | 40 |
| 46 IPC::TestSink sink_; | 41 IPC::TestSink sink_; |
| 47 | 42 |
| 48 // The last known good deserializer for sync messages. | 43 // The last known good deserializer for sync messages. |
| 49 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; | 44 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; |
| 50 | 45 |
| 51 int guest_instance_id_counter_; | |
| 52 MockBrowserPlugin* last_plugin_; | 46 MockBrowserPlugin* last_plugin_; |
| 53 | 47 |
| 54 DISALLOW_COPY_AND_ASSIGN(MockBrowserPluginManager); | 48 DISALLOW_COPY_AND_ASSIGN(MockBrowserPluginManager); |
| 55 }; | 49 }; |
| 56 | 50 |
| 57 } // namespace content | 51 } // namespace content |
| 58 | 52 |
| 59 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_ | 53 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_ |
| OLD | NEW |