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> | |
9 | |
10 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
11 | 9 |
12 namespace gfx { | 10 namespace gfx { |
13 class Size; | 11 class Size; |
14 } | 12 } |
15 | 13 |
16 namespace v8 { | 14 namespace v8 { |
17 class Isolate; | 15 class Isolate; |
18 class Object; | 16 class Object; |
19 template<typename T> class Local; | 17 template<typename T> class Local; |
20 } // namespace v8 | 18 } // namespace v8 |
21 | 19 |
22 namespace content { | 20 namespace content { |
23 | 21 |
24 class RenderFrame; | 22 class RenderFrame; |
25 | 23 |
26 // A delegate for BrowserPlugin which gets notified about the plugin load. | 24 // A delegate for BrowserPlugin which gets notified about the plugin load. |
27 // Implementations can provide additional steps necessary to change the load | 25 // Implementations can provide additional steps necessary to change the load |
28 // behavior of the plugin. | 26 // behavior of the plugin. |
29 class CONTENT_EXPORT BrowserPluginDelegate { | 27 class CONTENT_EXPORT BrowserPluginDelegate { |
30 public: | 28 public: |
31 virtual ~BrowserPluginDelegate() {} | |
32 | |
33 // Called when the BrowserPlugin's geometry has been computed for the first | 29 // Called when the BrowserPlugin's geometry has been computed for the first |
34 // time. | 30 // time. |
35 virtual void Ready() {} | 31 virtual void Ready() {} |
36 | 32 |
37 // Called when plugin document has finished loading. | 33 // Called when plugin document has finished loading. |
38 virtual void DidFinishLoading() {} | 34 virtual void DidFinishLoading() {} |
39 | 35 |
40 // Called when plugin document receives data. | 36 // Called when plugin document receives data. |
41 virtual void DidReceiveData(const char* data, int data_length) {} | 37 virtual void DidReceiveData(const char* data, int data_length) {} |
42 | 38 |
43 // Sets the instance ID that idenfies the plugin within current render | 39 // Sets the instance ID that idenfies the plugin within current render |
44 // process. | 40 // process. |
45 virtual void SetElementInstanceID(int element_instance_id) {} | 41 virtual void SetElementInstanceID(int element_instance_id) {} |
46 | 42 |
47 // Called when the plugin resizes. | 43 // Called when the plugin resizes. |
48 virtual void DidResizeElement(const gfx::Size& new_size) {} | 44 virtual void DidResizeElement(const gfx::Size& new_size) {} |
49 | 45 |
| 46 // Called when the plugin is about to be destroyed. |
| 47 virtual void DidDestroyElement() {} |
| 48 |
50 // Return a scriptable object for the plugin. | 49 // Return a scriptable object for the plugin. |
51 virtual v8::Local<v8::Object> V8ScriptableObject(v8::Isolate* isolate); | 50 virtual v8::Local<v8::Object> V8ScriptableObject(v8::Isolate* isolate); |
| 51 |
| 52 protected: |
| 53 virtual ~BrowserPluginDelegate() {} |
52 }; | 54 }; |
53 | 55 |
54 } // namespace content | 56 } // namespace content |
55 | 57 |
56 #endif // CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_ | 58 #endif // CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_ |
OLD | NEW |