| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 v8::Local<v8::Object> GetV8ScriptableObject( | 81 v8::Local<v8::Object> GetV8ScriptableObject( |
| 82 v8::Isolate* isolate) const override; | 82 v8::Isolate* isolate) const override; |
| 83 void OnUnobscuredRectUpdate(const gfx::Rect& unobscured_rect) override; | 83 void OnUnobscuredRectUpdate(const gfx::Rect& unobscured_rect) override; |
| 84 | 84 |
| 85 // RenderFrameObserver methods: | 85 // RenderFrameObserver methods: |
| 86 void WasShown() override; | 86 void WasShown() override; |
| 87 | 87 |
| 88 void UpdateMessage(); | 88 void UpdateMessage(); |
| 89 | 89 |
| 90 bool LoadingBlocked() const; | 90 bool LoadingBlocked() const; |
| 91 void RecheckSizeAndMaybeUnthrottle(); | |
| 92 | 91 |
| 93 // Plugin creation is embedder-specific. | 92 // Plugin creation is embedder-specific. |
| 94 virtual blink::WebPlugin* CreatePlugin() = 0; | 93 virtual blink::WebPlugin* CreatePlugin() = 0; |
| 95 | 94 |
| 96 content::WebPluginInfo plugin_info_; | 95 content::WebPluginInfo plugin_info_; |
| 97 | 96 |
| 98 base::string16 message_; | 97 base::string16 message_; |
| 99 | 98 |
| 100 // True if the plugin load was deferred due to page being a background tab. | 99 // True if the plugin load was deferred due to page being a background tab. |
| 101 // Plugin may be automatically loaded when the page is foregrounded. | 100 // Plugin may be automatically loaded when the page is foregrounded. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 113 bool power_saver_enabled_; | 112 bool power_saver_enabled_; |
| 114 | 113 |
| 115 // When we load, uses this premade plugin instead of creating a new one. | 114 // When we load, uses this premade plugin instead of creating a new one. |
| 116 content::PluginInstanceThrottler* premade_throttler_; | 115 content::PluginInstanceThrottler* premade_throttler_; |
| 117 | 116 |
| 118 bool allow_loading_; | 117 bool allow_loading_; |
| 119 | 118 |
| 120 bool finished_loading_; | 119 bool finished_loading_; |
| 121 std::string identifier_; | 120 std::string identifier_; |
| 122 | 121 |
| 123 // Used to prevent re-entrancy during the size recheck for throttled plugins. | |
| 124 bool in_size_recheck_; | |
| 125 gfx::Rect unobscured_rect_; | 122 gfx::Rect unobscured_rect_; |
| 126 base::OneShotTimer size_update_timer_; | |
| 127 | 123 |
| 128 // True if the power saver heuristic has already been run on this content. | 124 // True if the power saver heuristic has already been run on this content. |
| 129 bool heuristic_run_before_; | 125 bool heuristic_run_before_; |
| 130 | 126 |
| 131 base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_; | 127 base::WeakPtrFactory<LoadablePluginPlaceholder> weak_factory_; |
| 132 | 128 |
| 133 DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder); | 129 DISALLOW_COPY_AND_ASSIGN(LoadablePluginPlaceholder); |
| 134 }; | 130 }; |
| 135 | 131 |
| 136 } // namespace plugins | 132 } // namespace plugins |
| 137 | 133 |
| 138 #endif // COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ | 134 #endif // COMPONENTS_PLUGINS_RENDERER_LOADABLE_PLUGIN_PLACEHOLDER_H_ |
| OLD | NEW |