Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Unified Diff: components/plugins/renderer/plugin_placeholder.h

Issue 116163008: Move the plugin placeholder from CppBoundClass to gin::Wrappable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: counter-proposal Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/plugins/renderer/plugin_placeholder.h
diff --git a/components/plugins/renderer/plugin_placeholder.h b/components/plugins/renderer/plugin_placeholder.h
index d8b7d1a4b69727803ca0f9356ea4aff4554bf91b..ad3cf120d34cb7f4272abc561e659772980dc880 100644
--- a/components/plugins/renderer/plugin_placeholder.h
+++ b/components/plugins/renderer/plugin_placeholder.h
@@ -10,20 +10,29 @@
#include "content/public/renderer/context_menu_client.h"
#include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/render_process_observer.h"
+#include "gin/wrappable.h"
#include "third_party/WebKit/public/web/WebPluginParams.h"
-#include "webkit/renderer/cpp_bound_class.h"
namespace content {
struct WebPluginInfo;
}
+namespace gin {
+class ObjectTemplateBuilder;
+}
+
+namespace v8 {
+class Isolate;
+}
+
namespace plugins {
// Placeholders can be used if a plug-in is missing or not available
// (blocked or disabled).
class PluginPlaceholder : public content::RenderFrameObserver,
- public webkit_glue::CppBoundClass,
- public WebViewPlugin::Delegate {
+ public WebViewPlugin::Delegate,
+ public gin::Wrappable<PluginPlaceholder> {
public:
+ static gin::WrapperInfo kWrapperInfo;
WebViewPlugin* plugin() { return plugin_; }
@@ -34,6 +43,9 @@ class PluginPlaceholder : public content::RenderFrameObserver,
void set_allow_loading(bool allow_loading) { allow_loading_ = allow_loading; }
protected:
+ virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
+ v8::Isolate* isolate) OVERRIDE;
+
// |render_frame| and |frame| are weak pointers. If either one is going away,
// our |plugin_| will be destroyed as well and will notify us.
PluginPlaceholder(content::RenderFrame* render_frame,
@@ -65,28 +77,18 @@ class PluginPlaceholder : public content::RenderFrameObserver,
// Load the blocked plugin.
void LoadPlugin();
- // WebViewPlugin::Delegate method:
- virtual void BindWebFrame(blink::WebFrame* frame) OVERRIDE;
-
private:
// WebViewPlugin::Delegate methods:
- virtual void WillDestroyPlugin() OVERRIDE;
virtual void ShowContextMenu(const blink::WebMouseEvent&) OVERRIDE;
// Javascript callbacks:
- // All ignore arguments (which are, however, required by caller) and return
- // nothing.
-
// Load the blocked plugin by calling LoadPlugin().
- void LoadCallback(const webkit_glue::CppArgumentList& args,
- webkit_glue::CppVariant* result);
+ void LoadCallback();
// Hide the blocked plugin by calling HidePlugin().
- void HideCallback(const webkit_glue::CppArgumentList& args,
- webkit_glue::CppVariant* result);
+ void HideCallback();
- void DidFinishLoadingCallback(const webkit_glue::CppArgumentList& args,
- webkit_glue::CppVariant* result);
+ void DidFinishLoadingCallback();
void UpdateMessage();

Powered by Google App Engine
This is Rietveld 408576698