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

Unified Diff: content/public/renderer/plugin_instance_throttler.h

Issue 866173002: Plugin Power Saver: Add UI Overlay to throttled plugin using placeholder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: content/public/renderer/plugin_instance_throttler.h
diff --git a/content/public/renderer/plugin_instance_throttler.h b/content/public/renderer/plugin_instance_throttler.h
index 5fa327679794a658b62c58f191c39f24a236f664..376e6ab989f7a20e4f8d61a9eda485877e1f247a 100644
--- a/content/public/renderer/plugin_instance_throttler.h
+++ b/content/public/renderer/plugin_instance_throttler.h
@@ -10,6 +10,7 @@
#include "content/common/content_export.h"
class GURL;
+class SkBitmap;
namespace content {
@@ -61,7 +62,15 @@ class CONTENT_EXPORT PluginInstanceThrottler {
class Observer {
public:
- virtual void OnThrottleStateChange() = 0;
+ // Guaranteed to be called before the throttle is engaged.
+ virtual void OnKeyframeExtracted(const SkBitmap* bitmap) {}
+
+ virtual void OnThrottleStateChange() {}
+
+ // Called when the plugin should be hidden due to a placeholder.
+ virtual void OnHiddenForPlaceholder(bool hidden) {}
+
+ virtual void OnThrottlerDestroyed() {}
};
// Returns a nullptr if no throttler needed based on |power_saver_mode|.
@@ -78,10 +87,14 @@ class CONTENT_EXPORT PluginInstanceThrottler {
virtual void RemoveObserver(Observer* observer) = 0;
virtual bool IsThrottled() const = 0;
+ virtual bool IsHiddenForPlaceholder() const = 0;
// Marks the plugin as essential. Unthrottles the plugin if already throttled.
virtual void MarkPluginEssential(PowerSaverUnthrottleMethod method) = 0;
+ // Called by the placeholder when the plugin should temporarily be hidden.
+ virtual void SetHiddenForPlaceholder(bool hidden) = 0;
+
protected:
PluginInstanceThrottler() {}
« no previous file with comments | « components/plugins/renderer/plugin_placeholder.h ('k') | content/renderer/pepper/pepper_plugin_instance_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698