| 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 #include "components/plugins/renderer/loadable_plugin_placeholder.h" | 5 #include "components/plugins/renderer/loadable_plugin_placeholder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 v8::Local<v8::Object> LoadablePluginPlaceholder::GetV8ScriptableObject( | 173 v8::Local<v8::Object> LoadablePluginPlaceholder::GetV8ScriptableObject( |
| 174 v8::Isolate* isolate) const { | 174 v8::Isolate* isolate) const { |
| 175 // Pass through JavaScript access to the underlying throttled plugin. | 175 // Pass through JavaScript access to the underlying throttled plugin. |
| 176 if (premade_throttler_ && premade_throttler_->GetWebPlugin()) { | 176 if (premade_throttler_ && premade_throttler_->GetWebPlugin()) { |
| 177 return premade_throttler_->GetWebPlugin()->V8ScriptableObject(isolate); | 177 return premade_throttler_->GetWebPlugin()->V8ScriptableObject(isolate); |
| 178 } | 178 } |
| 179 return v8::Local<v8::Object>(); | 179 return v8::Local<v8::Object>(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool LoadablePluginPlaceholder::IsErrorPlaceholder() { |
| 183 return !allow_loading_; |
| 184 } |
| 185 |
| 182 void LoadablePluginPlaceholder::OnUnobscuredRectUpdate( | 186 void LoadablePluginPlaceholder::OnUnobscuredRectUpdate( |
| 183 const gfx::Rect& unobscured_rect) { | 187 const gfx::Rect& unobscured_rect) { |
| 184 DCHECK(content::RenderThread::Get()); | 188 DCHECK(content::RenderThread::Get()); |
| 185 if (!render_frame()) | 189 if (!render_frame()) |
| 186 return; | 190 return; |
| 187 | 191 |
| 188 if (!plugin() || !finished_loading_) | 192 if (!plugin() || !finished_loading_) |
| 189 return; | 193 return; |
| 190 | 194 |
| 191 if (!is_blocked_for_tinyness_ && !is_blocked_for_power_saver_poster_) | 195 if (!is_blocked_for_tinyness_ && !is_blocked_for_power_saver_poster_) |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 return identifier_; | 375 return identifier_; |
| 372 } | 376 } |
| 373 | 377 |
| 374 bool LoadablePluginPlaceholder::LoadingBlocked() const { | 378 bool LoadablePluginPlaceholder::LoadingBlocked() const { |
| 375 DCHECK(allow_loading_); | 379 DCHECK(allow_loading_); |
| 376 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ || | 380 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ || |
| 377 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_; | 381 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_; |
| 378 } | 382 } |
| 379 | 383 |
| 380 } // namespace plugins | 384 } // namespace plugins |
| OLD | NEW |