| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 395 } |
| 396 | 396 |
| 397 unsigned PluginInstance::GetBackingTextureId() { | 397 unsigned PluginInstance::GetBackingTextureId() { |
| 398 if (!bound_graphics_3d()) | 398 if (!bound_graphics_3d()) |
| 399 return 0; | 399 return 0; |
| 400 | 400 |
| 401 return bound_graphics_3d()->GetBackingTextureId(); | 401 return bound_graphics_3d()->GetBackingTextureId(); |
| 402 } | 402 } |
| 403 | 403 |
| 404 void PluginInstance::CommitBackingTexture() { | 404 void PluginInstance::CommitBackingTexture() { |
| 405 container_->commitBackingTexture(); | 405 if (fullscreen_container_) |
| 406 fullscreen_container_->Invalidate(); |
| 407 else |
| 408 container_->commitBackingTexture(); |
| 406 } | 409 } |
| 407 | 410 |
| 408 PP_Var PluginInstance::GetWindowObject() { | 411 PP_Var PluginInstance::GetWindowObject() { |
| 409 if (!container_) | 412 if (!container_) |
| 410 return PP_MakeUndefined(); | 413 return PP_MakeUndefined(); |
| 411 | 414 |
| 412 WebFrame* frame = container_->element().document().frame(); | 415 WebFrame* frame = container_->element().document().frame(); |
| 413 if (!frame) | 416 if (!frame) |
| 414 return PP_MakeUndefined(); | 417 return PP_MakeUndefined(); |
| 415 | 418 |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 WebURLRequest request(complete_url); | 932 WebURLRequest request(complete_url); |
| 930 document.frame()->setReferrerForRequest(request, GURL()); | 933 document.frame()->setReferrerForRequest(request, GURL()); |
| 931 request.setHTTPMethod(WebString::fromUTF8("GET")); | 934 request.setHTTPMethod(WebString::fromUTF8("GET")); |
| 932 request.setFirstPartyForCookies(document.firstPartyForCookies()); | 935 request.setFirstPartyForCookies(document.firstPartyForCookies()); |
| 933 | 936 |
| 934 WebString target_str = WebString::fromUTF8(target); | 937 WebString target_str = WebString::fromUTF8(target); |
| 935 container_->loadFrameRequest(request, target_str, false, NULL); | 938 container_->loadFrameRequest(request, target_str, false, NULL); |
| 936 return true; | 939 return true; |
| 937 } | 940 } |
| 938 | 941 |
| 942 PluginDelegate::PlatformContext3D* PluginInstance::CreateContext3D() { |
| 943 if (fullscreen_container_) |
| 944 return fullscreen_container_->CreateContext3D(); |
| 945 else |
| 946 return delegate_->CreateContext3D(); |
| 947 } |
| 948 |
| 939 bool PluginInstance::PrintPDFOutput(PP_Resource print_output, | 949 bool PluginInstance::PrintPDFOutput(PP_Resource print_output, |
| 940 WebKit::WebCanvas* canvas) { | 950 WebKit::WebCanvas* canvas) { |
| 941 scoped_refptr<PPB_Buffer_Impl> buffer( | 951 scoped_refptr<PPB_Buffer_Impl> buffer( |
| 942 Resource::GetAs<PPB_Buffer_Impl>(print_output)); | 952 Resource::GetAs<PPB_Buffer_Impl>(print_output)); |
| 943 if (!buffer.get() || !buffer->is_mapped() || !buffer->size()) { | 953 if (!buffer.get() || !buffer->is_mapped() || !buffer->size()) { |
| 944 NOTREACHED(); | 954 NOTREACHED(); |
| 945 return false; | 955 return false; |
| 946 } | 956 } |
| 947 #if defined(OS_WIN) | 957 #if defined(OS_WIN) |
| 948 // For Windows, we need the PDF DLL to render the output PDF to a DC. | 958 // For Windows, we need the PDF DLL to render the output PDF to a DC. |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 PPB_Surface3D_Impl* PluginInstance::bound_graphics_3d() const { | 1183 PPB_Surface3D_Impl* PluginInstance::bound_graphics_3d() const { |
| 1174 if (bound_graphics_.get() == NULL) | 1184 if (bound_graphics_.get() == NULL) |
| 1175 return NULL; | 1185 return NULL; |
| 1176 | 1186 |
| 1177 return bound_graphics_->Cast<PPB_Surface3D_Impl>(); | 1187 return bound_graphics_->Cast<PPB_Surface3D_Impl>(); |
| 1178 } | 1188 } |
| 1179 | 1189 |
| 1180 } // namespace ppapi | 1190 } // namespace ppapi |
| 1181 } // namespace webkit | 1191 } // namespace webkit |
| 1182 | 1192 |
| OLD | NEW |