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 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1102 checked_for_plugin_pdf_interface_ = true; | 1102 checked_for_plugin_pdf_interface_ = true; |
1103 plugin_pdf_interface_ = | 1103 plugin_pdf_interface_ = |
1104 static_cast<const PPP_Pdf_1*>(module_->GetPluginInterface( | 1104 static_cast<const PPP_Pdf_1*>(module_->GetPluginInterface( |
1105 PPP_PDF_INTERFACE_1)); | 1105 PPP_PDF_INTERFACE_1)); |
1106 } | 1106 } |
1107 | 1107 |
1108 return !!plugin_pdf_interface_; | 1108 return !!plugin_pdf_interface_; |
1109 } | 1109 } |
1110 | 1110 |
1111 bool PluginInstance::LoadPrintInterface() { | 1111 bool PluginInstance::LoadPrintInterface() { |
1112 // Only check for the interface if the plugin has dev permission. | |
1113 if (!module_->permissions().HasPermission(::ppapi::PERMISSION_DEV)) | |
1114 return false; | |
1115 if (!plugin_print_interface_) { | 1112 if (!plugin_print_interface_) { |
1116 plugin_print_interface_ = static_cast<const PPP_Printing_Dev*>( | 1113 plugin_print_interface_ = static_cast<const PPP_Printing_Dev*>( |
1117 module_->GetPluginInterface(PPP_PRINTING_DEV_INTERFACE)); | 1114 module_->GetPluginInterface(PPP_PRINTING_DEV_INTERFACE)); |
1118 } | 1115 } |
1119 return !!plugin_print_interface_; | 1116 return !!plugin_print_interface_; |
1120 } | 1117 } |
1121 | 1118 |
1122 bool PluginInstance::LoadPrivateInterface() { | 1119 bool PluginInstance::LoadPrivateInterface() { |
1123 if (!plugin_private_interface_) { | 1120 if (!plugin_private_interface_) { |
1124 plugin_private_interface_ = static_cast<const PPP_Instance_Private*>( | 1121 plugin_private_interface_ = static_cast<const PPP_Instance_Private*>( |
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2470 screen_size_for_fullscreen_ = gfx::Size(); | 2467 screen_size_for_fullscreen_ = gfx::Size(); |
2471 WebElement element = container_->element(); | 2468 WebElement element = container_->element(); |
2472 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2469 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2473 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2470 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2474 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2471 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2475 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2472 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2476 } | 2473 } |
2477 | 2474 |
2478 } // namespace ppapi | 2475 } // namespace ppapi |
2479 } // namespace webkit | 2476 } // namespace webkit |
OLD | NEW |