| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 56 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
| 57 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 57 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 58 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 59 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 59 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 60 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 60 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 61 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 61 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
| 62 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintParams.h" | 62 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintParams.h" |
| 63 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintScalingOption
.h" | 63 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPrintScalingOption
.h" |
| 64 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScopedUserGesture.
h" | 64 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScopedUserGesture.
h" |
| 65 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 65 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
| 66 #include "third_party/WebKit/Source/WebKit/chromium/public/WebUserGestureIndicat
or.h" |
| 66 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 67 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 67 #include "third_party/skia/include/core/SkCanvas.h" | 68 #include "third_party/skia/include/core/SkCanvas.h" |
| 68 #include "third_party/skia/include/core/SkRect.h" | 69 #include "third_party/skia/include/core/SkRect.h" |
| 69 #include "ui/base/range/range.h" | 70 #include "ui/base/range/range.h" |
| 70 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 71 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
| 71 #include "ui/gfx/rect_conversions.h" | 72 #include "ui/gfx/rect_conversions.h" |
| 72 #include "webkit/compositor_bindings/web_layer_impl.h" | 73 #include "webkit/compositor_bindings/web_layer_impl.h" |
| 73 #include "webkit/plugins/plugin_constants.h" | 74 #include "webkit/plugins/plugin_constants.h" |
| 74 #include "webkit/plugins/ppapi/common.h" | 75 #include "webkit/plugins/ppapi/common.h" |
| 75 #include "webkit/plugins/ppapi/content_decryptor_delegate.h" | 76 #include "webkit/plugins/ppapi/content_decryptor_delegate.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 using WebKit::WebElement; | 128 using WebKit::WebElement; |
| 128 using WebKit::WebFrame; | 129 using WebKit::WebFrame; |
| 129 using WebKit::WebInputEvent; | 130 using WebKit::WebInputEvent; |
| 130 using WebKit::WebPlugin; | 131 using WebKit::WebPlugin; |
| 131 using WebKit::WebPluginContainer; | 132 using WebKit::WebPluginContainer; |
| 132 using WebKit::WebPrintParams; | 133 using WebKit::WebPrintParams; |
| 133 using WebKit::WebPrintScalingOption; | 134 using WebKit::WebPrintScalingOption; |
| 134 using WebKit::WebScopedUserGesture; | 135 using WebKit::WebScopedUserGesture; |
| 135 using WebKit::WebString; | 136 using WebKit::WebString; |
| 136 using WebKit::WebURLRequest; | 137 using WebKit::WebURLRequest; |
| 138 using WebKit::WebUserGestureIndicator; |
| 137 using WebKit::WebView; | 139 using WebKit::WebView; |
| 138 | 140 |
| 139 namespace webkit { | 141 namespace webkit { |
| 140 namespace ppapi { | 142 namespace ppapi { |
| 141 | 143 |
| 142 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
| 143 // Exported by pdf.dll | 145 // Exported by pdf.dll |
| 144 typedef bool (*RenderPDFPageToDCProc)( | 146 typedef bool (*RenderPDFPageToDCProc)( |
| 145 const unsigned char* pdf_buffer, int buffer_size, int page_number, HDC dc, | 147 const unsigned char* pdf_buffer, int buffer_size, int page_number, HDC dc, |
| 146 int dpi_x, int dpi_y, int bounds_origin_x, int bounds_origin_y, | 148 int dpi_x, int dpi_y, int bounds_origin_x, int bounds_origin_y, |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 | 772 |
| 771 if ((filtered_input_event_mask_ & event_class) || | 773 if ((filtered_input_event_mask_ & event_class) || |
| 772 (input_event_mask_ & event_class)) { | 774 (input_event_mask_ & event_class)) { |
| 773 // Actually send the event. | 775 // Actually send the event. |
| 774 std::vector< ::ppapi::InputEventData > events; | 776 std::vector< ::ppapi::InputEventData > events; |
| 775 CreateInputEventData(event, &events); | 777 CreateInputEventData(event, &events); |
| 776 | 778 |
| 777 // Allow the user gesture to be pending after the plugin handles the | 779 // Allow the user gesture to be pending after the plugin handles the |
| 778 // event. This allows out-of-process plugins to respond to the user | 780 // event. This allows out-of-process plugins to respond to the user |
| 779 // gesture after processing has finished here. | 781 // gesture after processing has finished here. |
| 780 WebFrame* frame = container_->element().document().frame(); | 782 if (WebUserGestureIndicator::isProcessingUserGesture()) { |
| 781 if (frame->isProcessingUserGesture()) { | |
| 782 pending_user_gesture_ = | 783 pending_user_gesture_ = |
| 783 ::ppapi::EventTimeToPPTimeTicks(event.timeStampSeconds); | 784 ::ppapi::EventTimeToPPTimeTicks(event.timeStampSeconds); |
| 784 } | 785 } |
| 785 | 786 |
| 786 // Each input event may generate more than one PP_InputEvent. | 787 // Each input event may generate more than one PP_InputEvent. |
| 787 for (size_t i = 0; i < events.size(); i++) { | 788 for (size_t i = 0; i < events.size(); i++) { |
| 788 if (filtered_input_event_mask_ & event_class) | 789 if (filtered_input_event_mask_ & event_class) |
| 789 events[i].is_filtered = true; | 790 events[i].is_filtered = true; |
| 790 else | 791 else |
| 791 rv = true; // Unfiltered events are assumed to be handled. | 792 rv = true; // Unfiltered events are assumed to be handled. |
| (...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2482 screen_size_for_fullscreen_ = gfx::Size(); | 2483 screen_size_for_fullscreen_ = gfx::Size(); |
| 2483 WebElement element = container_->element(); | 2484 WebElement element = container_->element(); |
| 2484 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2485 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
| 2485 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2486 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
| 2486 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2487 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
| 2487 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2488 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
| 2488 } | 2489 } |
| 2489 | 2490 |
| 2490 } // namespace ppapi | 2491 } // namespace ppapi |
| 2491 } // namespace webkit | 2492 } // namespace webkit |
| OLD | NEW |