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