| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ |
| 6 #define CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ | 6 #define CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 virtual void OnKeyframeExtracted(const SkBitmap* bitmap) {} | 57 virtual void OnKeyframeExtracted(const SkBitmap* bitmap) {} |
| 58 | 58 |
| 59 virtual void OnThrottleStateChange() {} | 59 virtual void OnThrottleStateChange() {} |
| 60 | 60 |
| 61 // Called when the plugin should be hidden due to a placeholder. | 61 // Called when the plugin should be hidden due to a placeholder. |
| 62 virtual void OnHiddenForPlaceholder(bool hidden) {} | 62 virtual void OnHiddenForPlaceholder(bool hidden) {} |
| 63 | 63 |
| 64 virtual void OnThrottlerDestroyed() {} | 64 virtual void OnThrottlerDestroyed() {} |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 static scoped_ptr<PluginInstanceThrottler> Create(bool power_saver_enabled); | 67 static scoped_ptr<PluginInstanceThrottler> Create(); |
| 68 | 68 |
| 69 static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method); | 69 static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method); |
| 70 | 70 |
| 71 virtual ~PluginInstanceThrottler() {} | 71 virtual ~PluginInstanceThrottler() {} |
| 72 | 72 |
| 73 virtual void AddObserver(Observer* observer) = 0; | 73 virtual void AddObserver(Observer* observer) = 0; |
| 74 virtual void RemoveObserver(Observer* observer) = 0; | 74 virtual void RemoveObserver(Observer* observer) = 0; |
| 75 | 75 |
| 76 virtual bool IsThrottled() const = 0; | 76 virtual bool IsThrottled() const = 0; |
| 77 virtual bool IsHiddenForPlaceholder() const = 0; | 77 virtual bool IsHiddenForPlaceholder() const = 0; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 90 | 90 |
| 91 protected: | 91 protected: |
| 92 PluginInstanceThrottler() {} | 92 PluginInstanceThrottler() {} |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); | 95 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); |
| 96 }; | 96 }; |
| 97 } | 97 } |
| 98 | 98 |
| 99 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ | 99 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ |
| OLD | NEW |