Chromium Code Reviews| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 | 171 |
| 172 v8::Local<v8::Object> LoadablePluginPlaceholder::GetV8ScriptableObject( | 172 v8::Local<v8::Object> LoadablePluginPlaceholder::GetV8ScriptableObject( |
| 173 v8::Isolate* isolate) const { | 173 v8::Isolate* isolate) const { |
| 174 // Pass through JavaScript access to the underlying throttled plugin. | 174 // Pass through JavaScript access to the underlying throttled plugin. |
| 175 if (premade_throttler_ && premade_throttler_->GetWebPlugin()) { | 175 if (premade_throttler_ && premade_throttler_->GetWebPlugin()) { |
| 176 return premade_throttler_->GetWebPlugin()->v8ScriptableObject(isolate); | 176 return premade_throttler_->GetWebPlugin()->v8ScriptableObject(isolate); |
| 177 } | 177 } |
| 178 return v8::Local<v8::Object>(); | 178 return v8::Local<v8::Object>(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 bool LoadablePluginPlaceholder::isErrorPlaceholder() { | |
| 182 return !allow_loading_; | |
| 183 } | |
|
Bernhard Bauer
2017/03/30 09:08:28
Nit: empty line after this one.
George Joseph
2017/03/30 22:58:02
Done.
| |
| 181 void LoadablePluginPlaceholder::OnUnobscuredRectUpdate( | 184 void LoadablePluginPlaceholder::OnUnobscuredRectUpdate( |
| 182 const gfx::Rect& unobscured_rect) { | 185 const gfx::Rect& unobscured_rect) { |
| 183 DCHECK(content::RenderThread::Get()); | 186 DCHECK(content::RenderThread::Get()); |
| 184 | 187 |
| 185 if (!plugin() || !finished_loading_) | 188 if (!plugin() || !finished_loading_) |
| 186 return; | 189 return; |
| 187 | 190 |
| 188 if (!is_blocked_for_tinyness_ && !is_blocked_for_power_saver_poster_) | 191 if (!is_blocked_for_tinyness_ && !is_blocked_for_power_saver_poster_) |
| 189 return; | 192 return; |
| 190 | 193 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 return identifier_; | 369 return identifier_; |
| 367 } | 370 } |
| 368 | 371 |
| 369 bool LoadablePluginPlaceholder::LoadingBlocked() const { | 372 bool LoadablePluginPlaceholder::LoadingBlocked() const { |
| 370 DCHECK(allow_loading_); | 373 DCHECK(allow_loading_); |
| 371 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ || | 374 return is_blocked_for_tinyness_ || is_blocked_for_background_tab_ || |
| 372 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_; | 375 is_blocked_for_power_saver_poster_ || is_blocked_for_prerendering_; |
| 373 } | 376 } |
| 374 | 377 |
| 375 } // namespace plugins | 378 } // namespace plugins |
| OLD | NEW |