| 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 <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 class WebPlugin; | 14 class WebPlugin; |
| 14 struct WebPluginParams; | 15 struct WebPluginParams; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace gfx { | 18 namespace gfx { |
| 18 class Size; | 19 class Size; |
| 19 } | 20 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 virtual void OnThrottleStateChange() {} | 65 virtual void OnThrottleStateChange() {} |
| 65 | 66 |
| 66 virtual void OnPeripheralStateChange() {} | 67 virtual void OnPeripheralStateChange() {} |
| 67 | 68 |
| 68 // Called when the plugin should be hidden due to a placeholder. | 69 // Called when the plugin should be hidden due to a placeholder. |
| 69 virtual void OnHiddenForPlaceholder(bool hidden) {} | 70 virtual void OnHiddenForPlaceholder(bool hidden) {} |
| 70 | 71 |
| 71 virtual void OnThrottlerDestroyed() {} | 72 virtual void OnThrottlerDestroyed() {} |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 static scoped_ptr<PluginInstanceThrottler> Create(); | 75 static std::unique_ptr<PluginInstanceThrottler> Create(); |
| 75 | 76 |
| 76 static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method); | 77 static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method); |
| 77 | 78 |
| 78 virtual ~PluginInstanceThrottler() {} | 79 virtual ~PluginInstanceThrottler() {} |
| 79 | 80 |
| 80 virtual void AddObserver(Observer* observer) = 0; | 81 virtual void AddObserver(Observer* observer) = 0; |
| 81 virtual void RemoveObserver(Observer* observer) = 0; | 82 virtual void RemoveObserver(Observer* observer) = 0; |
| 82 | 83 |
| 83 virtual bool IsThrottled() const = 0; | 84 virtual bool IsThrottled() const = 0; |
| 84 virtual bool IsHiddenForPlaceholder() const = 0; | 85 virtual bool IsHiddenForPlaceholder() const = 0; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 100 | 101 |
| 101 protected: | 102 protected: |
| 102 PluginInstanceThrottler() {} | 103 PluginInstanceThrottler() {} |
| 103 | 104 |
| 104 private: | 105 private: |
| 105 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); | 106 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); |
| 106 }; | 107 }; |
| 107 } | 108 } |
| 108 | 109 |
| 109 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ | 110 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ |
| OLD | NEW |