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

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

Issue 1161923004: Reland: Plugin Placeholders: Refactor for platforms that don't support plugins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove some enable_plugins that are no longer needed Created 5 years, 6 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
« no previous file with comments | « components/plugins/renderer/BUILD.gn ('k') | components/plugins/renderer/loadable_plugin_placeholder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/plugins/renderer/loadable_plugin_placeholder.h
diff --git a/components/plugins/renderer/loadable_plugin_placeholder.h b/components/plugins/renderer/loadable_plugin_placeholder.h
index 0111dffc9540064f2ec29cd2089cc9911dc095e1..13b903df92292b05a8b89888a37542471a0151f7 100644
--- a/components/plugins/renderer/loadable_plugin_placeholder.h
+++ b/components/plugins/renderer/loadable_plugin_placeholder.h
@@ -10,11 +10,12 @@
#include "components/plugins/renderer/plugin_placeholder.h"
#include "content/public/common/webplugininfo.h"
#include "content/public/renderer/plugin_instance_throttler.h"
+#include "content/public/renderer/render_thread.h"
namespace plugins {
// Placeholders can be used if a plugin is missing or not available
// (blocked or disabled).
-class LoadablePluginPlaceholder : public PluginPlaceholder {
+class LoadablePluginPlaceholder : public PluginPlaceholderBase {
public:
void set_blocked_for_background_tab(bool blocked_for_background_tab) {
is_blocked_for_background_tab_ = blocked_for_background_tab;
@@ -24,7 +25,6 @@ class LoadablePluginPlaceholder : public PluginPlaceholder {
is_blocked_for_prerendering_ = blocked_for_prerendering;
}
-#if defined(ENABLE_PLUGINS)
bool power_saver_enabled() const { return power_saver_enabled_; }
void set_power_saver_enabled(bool power_saver_enabled) {
@@ -36,23 +36,19 @@ class LoadablePluginPlaceholder : public PluginPlaceholder {
// When we load the plugin, use this already-created plugin, not a new one.
void SetPremadePlugin(content::PluginInstanceThrottler* throttler);
-#endif
- void set_allow_loading(bool allow_loading) { allow_loading_ = allow_loading; }
+ void DisallowLoading() { allow_loading_ = false; }
protected:
LoadablePluginPlaceholder(content::RenderFrame* render_frame,
blink::WebLocalFrame* frame,
const blink::WebPluginParams& params,
- const std::string& html_data,
- GURL placeholderDataUrl);
+ const std::string& html_data);
~LoadablePluginPlaceholder() override;
-#if defined(ENABLE_PLUGINS)
void MarkPluginEssential(
content::PluginInstanceThrottler::PowerSaverUnthrottleMethod method);
-#endif
void OnLoadBlockedPlugins(const std::string& identifier);
void OnSetIsPrerendering(bool is_prerendering);
@@ -68,42 +64,27 @@ class LoadablePluginPlaceholder : public PluginPlaceholder {
// a placeholder again).
void ReplacePlugin(blink::WebPlugin* new_plugin);
- // Hide this placeholder.
- void HidePlugin();
-
// Load the blocked plugin.
void LoadPlugin();
- // WebViewPlugin::Delegate (via PluginPlaceholder) method
- void BindWebFrame(blink::WebFrame* frame) override;
-
- // gin::Wrappable method:
- gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
- v8::Isolate* isolate) override;
+ // Javascript callbacks:
+ void LoadCallback();
+ void DidFinishLoadingCallback();
private:
// WebViewPlugin::Delegate methods:
void PluginDestroyed() override;
v8::Local<v8::Object> GetV8ScriptableObject(
v8::Isolate* isolate) const override;
-#if defined(ENABLE_PLUGINS)
void OnUnobscuredSizeUpdate(const gfx::Size& unobscured_size) override;
-#endif
// RenderFrameObserver methods:
void WasShown() override;
- // Javascript callbacks:
- void LoadCallback();
- void HideCallback();
- void DidFinishLoadingCallback();
-
void UpdateMessage();
bool LoadingBlocked() const;
-#if defined(ENABLE_PLUGINS)
void RecheckSizeAndMaybeUnthrottle();
-#endif
// Plugin creation is embedder-specific.
virtual blink::WebPlugin* CreatePlugin() = 0;
@@ -132,7 +113,6 @@ class LoadablePluginPlaceholder : public PluginPlaceholder {
bool allow_loading_;
- bool hidden_;
bool finished_loading_;
std::string identifier_;
« no previous file with comments | « components/plugins/renderer/BUILD.gn ('k') | components/plugins/renderer/loadable_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698