| 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 "content/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 #include "ppapi/shared_impl/var.h" | 85 #include "ppapi/shared_impl/var.h" |
| 86 #include "ppapi/thunk/enter.h" | 86 #include "ppapi/thunk/enter.h" |
| 87 #include "ppapi/thunk/ppb_buffer_api.h" | 87 #include "ppapi/thunk/ppb_buffer_api.h" |
| 88 #include "printing/metafile.h" | 88 #include "printing/metafile.h" |
| 89 #include "printing/metafile_skia_wrapper.h" | 89 #include "printing/metafile_skia_wrapper.h" |
| 90 #include "printing/units.h" | 90 #include "printing/units.h" |
| 91 #include "skia/ext/platform_canvas.h" | 91 #include "skia/ext/platform_canvas.h" |
| 92 #include "skia/ext/platform_device.h" | 92 #include "skia/ext/platform_device.h" |
| 93 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 93 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
| 94 #include "third_party/WebKit/public/platform/WebGamepads.h" | 94 #include "third_party/WebKit/public/platform/WebGamepads.h" |
| 95 #include "third_party/WebKit/public/platform/WebRect.h" |
| 95 #include "third_party/WebKit/public/platform/WebString.h" | 96 #include "third_party/WebKit/public/platform/WebString.h" |
| 96 #include "third_party/WebKit/public/platform/WebURL.h" | 97 #include "third_party/WebKit/public/platform/WebURL.h" |
| 97 #include "third_party/WebKit/public/platform/WebURLError.h" | 98 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 98 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 99 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 99 #include "third_party/WebKit/public/web/WebBindings.h" | 100 #include "third_party/WebKit/public/web/WebBindings.h" |
| 100 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 101 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 101 #include "third_party/WebKit/public/web/WebDataSource.h" | 102 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 102 #include "third_party/WebKit/public/web/WebDocument.h" | 103 #include "third_party/WebKit/public/web/WebDocument.h" |
| 103 #include "third_party/WebKit/public/web/WebElement.h" | 104 #include "third_party/WebKit/public/web/WebElement.h" |
| 104 #include "third_party/WebKit/public/web/WebFrame.h" | 105 #include "third_party/WebKit/public/web/WebFrame.h" |
| (...skipping 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2413 | 2414 |
| 2414 void PepperPluginInstanceImpl::SelectedFindResultChanged(PP_Instance instance, | 2415 void PepperPluginInstanceImpl::SelectedFindResultChanged(PP_Instance instance, |
| 2415 int32_t index) { | 2416 int32_t index) { |
| 2416 DCHECK_NE(find_identifier_, -1); | 2417 DCHECK_NE(find_identifier_, -1); |
| 2417 if (render_frame_) { | 2418 if (render_frame_) { |
| 2418 render_frame_->reportFindInPageSelection( | 2419 render_frame_->reportFindInPageSelection( |
| 2419 find_identifier_, index + 1, blink::WebRect()); | 2420 find_identifier_, index + 1, blink::WebRect()); |
| 2420 } | 2421 } |
| 2421 } | 2422 } |
| 2422 | 2423 |
| 2424 void PepperPluginInstanceImpl::SetTickmarks(PP_Instance instance, |
| 2425 const PP_Rect* tickmarks, |
| 2426 uint32_t count) { |
| 2427 if (!render_frame_ || !render_frame_->GetWebFrame()) |
| 2428 return; |
| 2429 |
| 2430 blink::WebVector<blink::WebRect> tickmarks_converted( |
| 2431 static_cast<size_t>(count)); |
| 2432 for (uint32 i = 0; i < count; ++i) { |
| 2433 tickmarks_converted[i] = blink::WebRect(tickmarks[i].point.x, |
| 2434 tickmarks[i].point.y, |
| 2435 tickmarks[i].size.width, |
| 2436 tickmarks[i].size.height);; |
| 2437 } |
| 2438 blink::WebFrame* frame = render_frame_->GetWebFrame(); |
| 2439 frame->setTickmarks(tickmarks_converted); |
| 2440 } |
| 2441 |
| 2423 PP_Bool PepperPluginInstanceImpl::IsFullscreen(PP_Instance instance) { | 2442 PP_Bool PepperPluginInstanceImpl::IsFullscreen(PP_Instance instance) { |
| 2424 return PP_FromBool(view_data_.is_fullscreen); | 2443 return PP_FromBool(view_data_.is_fullscreen); |
| 2425 } | 2444 } |
| 2426 | 2445 |
| 2427 PP_Bool PepperPluginInstanceImpl::SetFullscreen(PP_Instance instance, | 2446 PP_Bool PepperPluginInstanceImpl::SetFullscreen(PP_Instance instance, |
| 2428 PP_Bool fullscreen) { | 2447 PP_Bool fullscreen) { |
| 2429 return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen))); | 2448 return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen))); |
| 2430 } | 2449 } |
| 2431 | 2450 |
| 2432 PP_Bool PepperPluginInstanceImpl::GetScreenSize(PP_Instance instance, | 2451 PP_Bool PepperPluginInstanceImpl::GetScreenSize(PP_Instance instance, |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3158 // Running out-of-process. Initiate an IPC call to notify the plugin | 3177 // Running out-of-process. Initiate an IPC call to notify the plugin |
| 3159 // process. | 3178 // process. |
| 3160 ppapi::proxy::HostDispatcher* dispatcher = | 3179 ppapi::proxy::HostDispatcher* dispatcher = |
| 3161 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3180 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
| 3162 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3181 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
| 3163 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3182 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
| 3164 } | 3183 } |
| 3165 } | 3184 } |
| 3166 | 3185 |
| 3167 } // namespace content | 3186 } // namespace content |
| OLD | NEW |