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

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

Issue 1126073003: Plugin Placeholders: Refactor for platforms that don't support plugins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: The version that was reverted. Created 5 years, 7 months 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 5d9caa10ee4f33876c7a335d439b14107b12be48..e5fff232372473d5137c52c4247625a142a57e15 100644
--- a/components/plugins/renderer/plugin_placeholder.h
+++ b/components/plugins/renderer/plugin_placeholder.h
@@ -8,7 +8,9 @@
#include "base/memory/weak_ptr.h"
#include "components/plugins/renderer/webview_plugin.h"
#include "content/public/renderer/render_frame_observer.h"
+#include "gin/handle.h"
#include "gin/wrappable.h"
+#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebPluginParams.h"
namespace plugins {
@@ -19,36 +21,51 @@ class PluginPlaceholder : public content::RenderFrameObserver,
public:
static gin::WrapperInfo kWrapperInfo;
- WebViewPlugin* plugin() { return plugin_; }
-
- protected:
// |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,
blink::WebLocalFrame* frame,
const blink::WebPluginParams& params,
- const std::string& html_data,
- GURL placeholderDataUrl);
+ const std::string& html_data);
~PluginPlaceholder() override;
+ WebViewPlugin* plugin() { return plugin_; }
+
+ protected:
blink::WebLocalFrame* GetFrame();
const blink::WebPluginParams& GetPluginParams() const;
// WebViewPlugin::Delegate methods:
+ void BindWebFrame(blink::WebFrame* frame) override;
void ShowContextMenu(const blink::WebMouseEvent&) override;
void PluginDestroyed() override;
+
v8::Local<v8::Object> GetV8ScriptableObject(
v8::Isolate* isolate) const override;
+ // gin::Wrappable method:
+ gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
+ v8::Isolate* isolate) override;
+
+ protected:
+ // Hide this placeholder.
+ void HidePlugin();
+ bool hidden() { return hidden_; }
+
private:
// RenderFrameObserver methods:
void OnDestruct() override;
+ // JavaScript callbacks:
+ void HideCallback();
+
blink::WebLocalFrame* frame_;
blink::WebPluginParams plugin_params_;
WebViewPlugin* plugin_;
+ bool hidden_;
+
DISALLOW_COPY_AND_ASSIGN(PluginPlaceholder);
};
« no previous file with comments | « components/plugins/renderer/mobile_youtube_plugin.cc ('k') | components/plugins/renderer/plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698