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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_
6 #define CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_
10 #include "content/common/content_export.h"
11 #include "ipc/ipc_message.h"
20 template<typename T
> class Local
;
27 // A delegate for BrowserPlugin which gets notified about the plugin load.
28 // Implementations can provide additional steps necessary to change the load
29 // behavior of the plugin.
30 class CONTENT_EXPORT BrowserPluginDelegate
{
32 virtual ~BrowserPluginDelegate() {}
34 // Called when the BrowserPlugin's geometry has been computed for the first
36 virtual void Ready() {}
38 // Called when plugin document has finished loading.
39 virtual void DidFinishLoading() {}
41 // Called when plugin document receives data.
42 virtual void DidReceiveData(const char* data
, int data_length
) {}
44 // Sets the instance ID that idenfies the plugin within current render
46 virtual void SetElementInstanceID(int element_instance_id
) {}
48 // Called when the plugin resizes.
49 virtual void DidResizeElement(const gfx::Size
& old_size
,
50 const gfx::Size
& new_size
) {}
52 // Called when a message is received. Returns true iff the message was
54 virtual bool OnMessageReceived(const IPC::Message
& message
);
56 // Return a scriptable object for the plugin.
57 virtual v8::Local
<v8::Object
> V8ScriptableObject(v8::Isolate
* isolate
);
60 } // namespace content
62 #endif // CONTENT_PUBLIC_RENDERER_BROWSER_PLUGIN_DELEGATE_H_