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/npapi/webplugin_impl.h" | 5 #include "content/renderer/npapi/webplugin_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 using blink::WebCanvas; | 65 using blink::WebCanvas; |
66 using blink::WebConsoleMessage; | 66 using blink::WebConsoleMessage; |
67 using blink::WebCookieJar; | 67 using blink::WebCookieJar; |
68 using blink::WebCursorInfo; | 68 using blink::WebCursorInfo; |
69 using blink::WebData; | 69 using blink::WebData; |
70 using blink::WebDataSource; | 70 using blink::WebDataSource; |
71 using blink::WebFrame; | 71 using blink::WebFrame; |
72 using blink::WebHTTPBody; | 72 using blink::WebHTTPBody; |
73 using blink::WebHTTPHeaderVisitor; | 73 using blink::WebHTTPHeaderVisitor; |
74 using blink::WebInputEvent; | 74 using blink::WebInputEvent; |
75 using blink::WebInputEventResult; | |
75 using blink::WebKeyboardEvent; | 76 using blink::WebKeyboardEvent; |
76 using blink::WebMouseEvent; | 77 using blink::WebMouseEvent; |
77 using blink::WebPluginContainer; | 78 using blink::WebPluginContainer; |
78 using blink::WebPluginParams; | 79 using blink::WebPluginParams; |
79 using blink::WebRect; | 80 using blink::WebRect; |
80 using blink::WebString; | 81 using blink::WebString; |
81 using blink::WebURL; | 82 using blink::WebURL; |
82 using blink::WebURLError; | 83 using blink::WebURLError; |
83 using blink::WebURLLoader; | 84 using blink::WebURLLoader; |
84 using blink::WebURLLoaderClient; | 85 using blink::WebURLLoaderClient; |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
411 move.rects_valid = false; | 412 move.rects_valid = false; |
412 move.visible = visible; | 413 move.visible = visible; |
413 | 414 |
414 render_frame_->GetRenderWidget()->SchedulePluginMove(move); | 415 render_frame_->GetRenderWidget()->SchedulePluginMove(move); |
415 } | 416 } |
416 | 417 |
417 bool WebPluginImpl::acceptsInputEvents() { | 418 bool WebPluginImpl::acceptsInputEvents() { |
418 return accepts_input_events_; | 419 return accepts_input_events_; |
419 } | 420 } |
420 | 421 |
421 bool WebPluginImpl::handleInputEvent( | 422 WebInputEventResult WebPluginImpl::handleInputEvent( |
422 const WebInputEvent& event, WebCursorInfo& cursor_info) { | 423 const WebInputEvent& event, |
424 WebCursorInfo& cursor_info) { | |
423 // Swallow context menu events in order to suppress the default context menu. | 425 // Swallow context menu events in order to suppress the default context menu. |
424 if (event.type == WebInputEvent::ContextMenu) | 426 if (event.type == WebInputEvent::ContextMenu) |
425 return true; | 427 return WebInputEventResult::HandledDefaultHandler; |
426 | 428 |
427 WebCursor::CursorInfo web_cursor_info; | 429 WebCursor::CursorInfo web_cursor_info; |
428 bool ret = delegate_->HandleInputEvent(event, &web_cursor_info); | 430 bool ret = delegate_->HandleInputEvent(event, &web_cursor_info); |
429 cursor_info.type = web_cursor_info.type; | 431 cursor_info.type = web_cursor_info.type; |
430 cursor_info.hotSpot = web_cursor_info.hotspot; | 432 cursor_info.hotSpot = web_cursor_info.hotspot; |
431 cursor_info.customImage = web_cursor_info.custom_image; | 433 cursor_info.customImage = web_cursor_info.custom_image; |
432 cursor_info.imageScaleFactor = web_cursor_info.image_scale_factor; | 434 cursor_info.imageScaleFactor = web_cursor_info.image_scale_factor; |
433 #if defined(OS_WIN) | 435 #if defined(OS_WIN) |
434 cursor_info.externalHandle = web_cursor_info.external_handle; | 436 cursor_info.externalHandle = web_cursor_info.external_handle; |
435 #endif | 437 #endif |
436 return ret; | 438 return ret ? WebInputEventResult::HandledDefaultHandler |
Rick Byers
2015/11/23 21:59:55
'true' here can mean two things here (script or de
dtapuska
2015/11/24 15:23:02
see other comment in the fullscreen plugin.
| |
439 : WebInputEventResult::NotHandled; | |
437 } | 440 } |
438 | 441 |
439 void WebPluginImpl::didReceiveResponse(const WebURLResponse& response) { | 442 void WebPluginImpl::didReceiveResponse(const WebURLResponse& response) { |
440 ignore_response_error_ = false; | 443 ignore_response_error_ = false; |
441 | 444 |
442 ResponseInfo response_info; | 445 ResponseInfo response_info; |
443 GetResponseInfo(response, &response_info); | 446 GetResponseInfo(response, &response_info); |
444 | 447 |
445 delegate_->DidReceiveManualResponse( | 448 delegate_->DidReceiveManualResponse( |
446 response_info.url, | 449 response_info.url, |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1549 case PLUGIN_SRC: | 1552 case PLUGIN_SRC: |
1550 webframe_->setReferrerForRequest(*request, plugin_url_); | 1553 webframe_->setReferrerForRequest(*request, plugin_url_); |
1551 break; | 1554 break; |
1552 | 1555 |
1553 default: | 1556 default: |
1554 break; | 1557 break; |
1555 } | 1558 } |
1556 } | 1559 } |
1557 | 1560 |
1558 } // namespace content | 1561 } // namespace content |
OLD | NEW |