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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 using ppapi::Var; | 109 using ppapi::Var; |
110 using ppapi::ViewData; | 110 using ppapi::ViewData; |
111 using WebKit::WebBindings; | 111 using WebKit::WebBindings; |
112 using WebKit::WebCanvas; | 112 using WebKit::WebCanvas; |
113 using WebKit::WebConsoleMessage; | 113 using WebKit::WebConsoleMessage; |
114 using WebKit::WebCursorInfo; | 114 using WebKit::WebCursorInfo; |
115 using WebKit::WebDocument; | 115 using WebKit::WebDocument; |
116 using WebKit::WebElement; | 116 using WebKit::WebElement; |
117 using WebKit::WebFrame; | 117 using WebKit::WebFrame; |
118 using WebKit::WebInputEvent; | 118 using WebKit::WebInputEvent; |
| 119 using WebKit::WebPlugin; |
119 using WebKit::WebPluginContainer; | 120 using WebKit::WebPluginContainer; |
120 using WebKit::WebString; | 121 using WebKit::WebString; |
121 using WebKit::WebURLRequest; | 122 using WebKit::WebURLRequest; |
122 using WebKit::WebView; | 123 using WebKit::WebView; |
123 | 124 |
124 namespace webkit { | 125 namespace webkit { |
125 namespace ppapi { | 126 namespace ppapi { |
126 | 127 |
127 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
128 // Exported by pdf.dll | 129 // Exported by pdf.dll |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 DCHECK(plugin_print_interface_); | 1193 DCHECK(plugin_print_interface_); |
1193 if (plugin_print_interface_) | 1194 if (plugin_print_interface_) |
1194 plugin_print_interface_->End(pp_instance()); | 1195 plugin_print_interface_->End(pp_instance()); |
1195 | 1196 |
1196 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); | 1197 memset(¤t_print_settings_, 0, sizeof(current_print_settings_)); |
1197 #if defined(OS_MACOSX) | 1198 #if defined(OS_MACOSX) |
1198 last_printed_page_ = NULL; | 1199 last_printed_page_ = NULL; |
1199 #endif // defined(OS_MACOSX) | 1200 #endif // defined(OS_MACOSX) |
1200 } | 1201 } |
1201 | 1202 |
| 1203 bool PluginInstance::CanRotateView() { |
| 1204 if (!LoadPdfInterface()) |
| 1205 return false; |
| 1206 |
| 1207 return true; |
| 1208 } |
| 1209 |
| 1210 void PluginInstance::RotateView(WebPlugin::RotationType type) { |
| 1211 if (!LoadPdfInterface()) |
| 1212 return; |
| 1213 PP_PrivatePageTransformType transform_type = |
| 1214 type == WebPlugin::RotationType90Clockwise ? |
| 1215 PP_PRIVATEPAGETRANSFORMTYPE_ROTATE_90_CW : |
| 1216 PP_PRIVATEPAGETRANSFORMTYPE_ROTATE_90_CCW; |
| 1217 plugin_pdf_interface_->Transform(pp_instance(), transform_type); |
| 1218 // NOTE: plugin instance may have been deleted. |
| 1219 } |
| 1220 |
1202 bool PluginInstance::FlashIsFullscreenOrPending() { | 1221 bool PluginInstance::FlashIsFullscreenOrPending() { |
1203 return fullscreen_container_ != NULL; | 1222 return fullscreen_container_ != NULL; |
1204 } | 1223 } |
1205 | 1224 |
1206 bool PluginInstance::IsFullscreenOrPending() { | 1225 bool PluginInstance::IsFullscreenOrPending() { |
1207 return desired_fullscreen_state_; | 1226 return desired_fullscreen_state_; |
1208 } | 1227 } |
1209 | 1228 |
1210 bool PluginInstance::SetFullscreen(bool fullscreen) { | 1229 bool PluginInstance::SetFullscreen(bool fullscreen) { |
1211 // Keep a reference on the stack. See NOTE above. | 1230 // Keep a reference on the stack. See NOTE above. |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2099 screen_size_for_fullscreen_ = gfx::Size(); | 2118 screen_size_for_fullscreen_ = gfx::Size(); |
2100 WebElement element = container_->element(); | 2119 WebElement element = container_->element(); |
2101 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2120 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2102 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2121 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2103 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2122 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2104 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2123 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2105 } | 2124 } |
2106 | 2125 |
2107 } // namespace ppapi | 2126 } // namespace ppapi |
2108 } // namespace webkit | 2127 } // namespace webkit |
OLD | NEW |