| 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 COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ | 5 #ifndef COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ |
| 6 #define COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ | 6 #define COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 void set_power_saver_enabled(bool power_saver_enabled) { | 38 void set_power_saver_enabled(bool power_saver_enabled) { |
| 39 power_saver_enabled_ = power_saver_enabled; | 39 power_saver_enabled_ = power_saver_enabled; |
| 40 } | 40 } |
| 41 | 41 |
| 42 // Defer loading of plugin, and instead show the Power Saver poster image. | 42 // Defer loading of plugin, and instead show the Power Saver poster image. |
| 43 void BlockForPowerSaverPoster(); | 43 void BlockForPowerSaverPoster(); |
| 44 | 44 |
| 45 // When we load the plugin, use this already-created plugin, not a new one. | 45 // When we load the plugin, use this already-created plugin, not a new one. |
| 46 void SetPremadePlugin(content::PluginInstanceThrottler* throttler); | 46 void SetPremadePlugin(content::PluginInstanceThrottler* throttler); |
| 47 | 47 |
| 48 void AllowLoading() { allow_loading_ = true; } | 48 void AllowLoading() { |
| 49 plugin()->unmarkAsErrorPlaceholder(); |
| 50 allow_loading_ = true; |
| 51 } |
| 49 | 52 |
| 50 protected: | 53 protected: |
| 51 LoadablePluginPlaceholder(content::RenderFrame* render_frame, | 54 LoadablePluginPlaceholder(content::RenderFrame* render_frame, |
| 52 blink::WebLocalFrame* frame, | 55 blink::WebLocalFrame* frame, |
| 53 const blink::WebPluginParams& params, | 56 const blink::WebPluginParams& params, |
| 54 const std::string& html_data); | 57 const std::string& html_data); |
| 55 | 58 |
| 56 ~LoadablePluginPlaceholder() override; | 59 ~LoadablePluginPlaceholder() override; |
| 57 | 60 |
| 58 void MarkPluginEssential( | 61 void MarkPluginEssential( |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 gfx::Rect unobscured_rect_; | 142 gfx::Rect unobscured_rect_; |
| 140 | 143 |
| 141 base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_; | 144 base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_; |
| 142 | 145 |
| 143 DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder); | 146 DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder); |
| 144 }; | 147 }; |
| 145 | 148 |
| 146 } // namespace plugins | 149 } // namespace plugins |
| 147 | 150 |
| 148 #endif // COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ | 151 #endif // COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ |
| OLD | NEW |