OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "ipc/ipc_message.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 class RenderFrame; | 15 class RenderFrame; |
15 | 16 |
16 // A delegate for BrowserPlugin which gets notified about the plugin load. | 17 // A delegate for BrowserPlugin which gets notified about the plugin load. |
17 // Implementations can provide additional steps necessary to change the load | 18 // Implementations can provide additional steps necessary to change the load |
18 // behavior of the plugin. | 19 // behavior of the plugin. |
19 class CONTENT_EXPORT BrowserPluginDelegate { | 20 class CONTENT_EXPORT BrowserPluginDelegate { |
20 public: | 21 public: |
21 virtual ~BrowserPluginDelegate() {} | 22 virtual ~BrowserPluginDelegate() {} |
22 | 23 |
23 // Called when the BrowserPlugin's geometry has been computed for the first | 24 // Called when the BrowserPlugin's geometry has been computed for the first |
24 // time. | 25 // time. |
25 virtual void Ready() {} | 26 virtual void Ready() {} |
26 | 27 |
27 // Called when plugin document has finished loading. | 28 // Called when plugin document has finished loading. |
28 virtual void DidFinishLoading() {} | 29 virtual void DidFinishLoading() {} |
29 | 30 |
30 // Called when plugin document receives data. | 31 // Called when plugin document receives data. |
31 virtual void DidReceiveData(const char* data, int data_length) {} | 32 virtual void DidReceiveData(const char* data, int data_length) {} |
32 | 33 |
33 // Sets the instance ID that idenfies the plugin within current render | 34 // Sets the instance ID that idenfies the plugin within current render |
34 // process. | 35 // process. |
35 virtual void SetElementInstanceID(int element_instance_id) {} | 36 virtual void SetElementInstanceID(int element_instance_id) {} |
| 37 |
| 38 // Called when a message is received. Returns true iff the message was |
| 39 // handled. |
| 40 virtual bool OnMessageReceived(const IPC::Message& message); |
36 }; | 41 }; |
37 | 42 |
38 } // namespace content | 43 } // namespace content |
39 | 44 |
40 #endif // CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_ | 45 #endif // CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_ |
OLD | NEW |