| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1709 texture_layer_->ClearClient(); | 1709 texture_layer_->ClearClient(); |
| 1710 if (!layer_bound_to_fullscreen_) | 1710 if (!layer_bound_to_fullscreen_) |
| 1711 container_->setWebLayer(NULL); | 1711 container_->setWebLayer(NULL); |
| 1712 else if (fullscreen_container_) | 1712 else if (fullscreen_container_) |
| 1713 fullscreen_container_->SetLayer(NULL); | 1713 fullscreen_container_->SetLayer(NULL); |
| 1714 web_layer_.reset(); | 1714 web_layer_.reset(); |
| 1715 texture_layer_ = NULL; | 1715 texture_layer_ = NULL; |
| 1716 } | 1716 } |
| 1717 if (want_layer) { | 1717 if (want_layer) { |
| 1718 DCHECK(bound_graphics_3d_.get()); | 1718 DCHECK(bound_graphics_3d_.get()); |
| 1719 texture_layer_ = cc::TextureLayer::Create(this); | 1719 texture_layer_ = cc::TextureLayer::Create(this, false); |
| 1720 web_layer_.reset(new WebKit::WebLayerImpl(texture_layer_)); | 1720 web_layer_.reset(new WebKit::WebLayerImpl(texture_layer_)); |
| 1721 if (fullscreen_container_) | 1721 if (fullscreen_container_) |
| 1722 fullscreen_container_->SetLayer(web_layer_.get()); | 1722 fullscreen_container_->SetLayer(web_layer_.get()); |
| 1723 else | 1723 else |
| 1724 container_->setWebLayer(web_layer_.get()); | 1724 container_->setWebLayer(web_layer_.get()); |
| 1725 texture_layer_->SetContentsOpaque(bound_graphics_3d_->IsOpaque()); | 1725 texture_layer_->SetContentsOpaque(bound_graphics_3d_->IsOpaque()); |
| 1726 } | 1726 } |
| 1727 layer_bound_to_fullscreen_ = !!fullscreen_container_; | 1727 layer_bound_to_fullscreen_ = !!fullscreen_container_; |
| 1728 } | 1728 } |
| 1729 | 1729 |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2082 unsigned PluginInstance::prepareTexture(cc::ResourceUpdateQueue&) { | 2082 unsigned PluginInstance::prepareTexture(cc::ResourceUpdateQueue&) { |
| 2083 return GetBackingTextureId(); | 2083 return GetBackingTextureId(); |
| 2084 } | 2084 } |
| 2085 | 2085 |
| 2086 WebKit::WebGraphicsContext3D* PluginInstance::context() { | 2086 WebKit::WebGraphicsContext3D* PluginInstance::context() { |
| 2087 DCHECK(bound_graphics_3d_.get()); | 2087 DCHECK(bound_graphics_3d_.get()); |
| 2088 DCHECK(bound_graphics_3d_->platform_context()); | 2088 DCHECK(bound_graphics_3d_->platform_context()); |
| 2089 return bound_graphics_3d_->platform_context()->GetParentContext(); | 2089 return bound_graphics_3d_->platform_context()->GetParentContext(); |
| 2090 } | 2090 } |
| 2091 | 2091 |
| 2092 bool PluginInstance::prepareTextureMailbox(cc::TextureMailbox*) { |
| 2093 return false; |
| 2094 } |
| 2095 |
| 2092 void PluginInstance::NumberOfFindResultsChanged(PP_Instance instance, | 2096 void PluginInstance::NumberOfFindResultsChanged(PP_Instance instance, |
| 2093 int32_t total, | 2097 int32_t total, |
| 2094 PP_Bool final_result) { | 2098 PP_Bool final_result) { |
| 2095 DCHECK_NE(find_identifier_, -1); | 2099 DCHECK_NE(find_identifier_, -1); |
| 2096 delegate_->NumberOfFindResultsChanged(find_identifier_, total, | 2100 delegate_->NumberOfFindResultsChanged(find_identifier_, total, |
| 2097 PP_ToBool(final_result)); | 2101 PP_ToBool(final_result)); |
| 2098 } | 2102 } |
| 2099 | 2103 |
| 2100 void PluginInstance::SelectedFindResultChanged(PP_Instance instance, | 2104 void PluginInstance::SelectedFindResultChanged(PP_Instance instance, |
| 2101 int32_t index) { | 2105 int32_t index) { |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2488 screen_size_for_fullscreen_ = gfx::Size(); | 2492 screen_size_for_fullscreen_ = gfx::Size(); |
| 2489 WebElement element = container_->element(); | 2493 WebElement element = container_->element(); |
| 2490 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2494 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
| 2491 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2495 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
| 2492 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2496 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
| 2493 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2497 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
| 2494 } | 2498 } |
| 2495 | 2499 |
| 2496 } // namespace ppapi | 2500 } // namespace ppapi |
| 2497 } // namespace webkit | 2501 } // namespace webkit |
| OLD | NEW |