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