| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 UNTHROTTLE_METHOD_NUM_ITEMS | 55 UNTHROTTLE_METHOD_NUM_ITEMS |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class Observer { | 58 class Observer { |
| 59 public: | 59 public: |
| 60 // Guaranteed to be called before the throttle is engaged. | 60 // Guaranteed to be called before the throttle is engaged. |
| 61 virtual void OnKeyframeExtracted(const SkBitmap* bitmap) {} | 61 virtual void OnKeyframeExtracted(const SkBitmap* bitmap) {} |
| 62 | 62 |
| 63 virtual void OnThrottleStateChange() {} | 63 virtual void OnThrottleStateChange() {} |
| 64 | 64 |
| 65 virtual void OnPeripheralStateChange() {} |
| 66 |
| 65 // Called when the plugin should be hidden due to a placeholder. | 67 // Called when the plugin should be hidden due to a placeholder. |
| 66 virtual void OnHiddenForPlaceholder(bool hidden) {} | 68 virtual void OnHiddenForPlaceholder(bool hidden) {} |
| 67 | 69 |
| 68 virtual void OnThrottlerDestroyed() {} | 70 virtual void OnThrottlerDestroyed() {} |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 static scoped_ptr<PluginInstanceThrottler> Create(); | 73 static scoped_ptr<PluginInstanceThrottler> Create(); |
| 72 | 74 |
| 73 static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method); | 75 static void RecordUnthrottleMethodMetric(PowerSaverUnthrottleMethod method); |
| 74 | 76 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 97 | 99 |
| 98 protected: | 100 protected: |
| 99 PluginInstanceThrottler() {} | 101 PluginInstanceThrottler() {} |
| 100 | 102 |
| 101 private: | 103 private: |
| 102 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); | 104 DISALLOW_COPY_AND_ASSIGN(PluginInstanceThrottler); |
| 103 }; | 105 }; |
| 104 } | 106 } |
| 105 | 107 |
| 106 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ | 108 #endif // CONTENT_PUBLIC_RENDERER_PLUGIN_INSTANCE_THROTTLER_H_ |
| OLD | NEW |