| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 } | 704 } |
| 705 | 705 |
| 706 void WebPluginContainerImpl::HandleMouseEvent(MouseEvent* event) { | 706 void WebPluginContainerImpl::HandleMouseEvent(MouseEvent* event) { |
| 707 DCHECK(Parent()->IsFrameView()); | 707 DCHECK(Parent()->IsFrameView()); |
| 708 | 708 |
| 709 // We cache the parent FrameView here as the plugin widget could be deleted | 709 // We cache the parent FrameView here as the plugin widget could be deleted |
| 710 // in the call to HandleEvent. See http://b/issue?id=1362948 | 710 // in the call to HandleEvent. See http://b/issue?id=1362948 |
| 711 FrameView* parent_view = ToFrameView(Parent()); | 711 FrameView* parent_view = ToFrameView(Parent()); |
| 712 | 712 |
| 713 WebMouseEventBuilder transformed_event( | 713 WebMouseEventBuilder transformed_event( |
| 714 this, LayoutItem(element_->GetLayoutObject()), *event); | 714 ToFrameView(Parent()), LayoutItem(element_->GetLayoutObject()), *event); |
| 715 if (transformed_event.GetType() == WebInputEvent::kUndefined) | 715 if (transformed_event.GetType() == WebInputEvent::kUndefined) |
| 716 return; | 716 return; |
| 717 | 717 |
| 718 if (event->type() == EventTypeNames::mousedown) | 718 if (event->type() == EventTypeNames::mousedown) |
| 719 FocusPlugin(); | 719 FocusPlugin(); |
| 720 | 720 |
| 721 WebCursorInfo cursor_info; | 721 WebCursorInfo cursor_info; |
| 722 if (web_plugin_ && | 722 if (web_plugin_ && |
| 723 web_plugin_->HandleInputEvent(transformed_event, cursor_info) != | 723 web_plugin_->HandleInputEvent(transformed_event, cursor_info) != |
| 724 WebInputEventResult::kNotHandled) | 724 WebInputEventResult::kNotHandled) |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 if (web_plugin_->HandleInputEvent(translated_event, cursor_info) != | 875 if (web_plugin_->HandleInputEvent(translated_event, cursor_info) != |
| 876 WebInputEventResult::kNotHandled) { | 876 WebInputEventResult::kNotHandled) { |
| 877 event->SetDefaultHandled(); | 877 event->SetDefaultHandled(); |
| 878 return; | 878 return; |
| 879 } | 879 } |
| 880 | 880 |
| 881 // FIXME: Can a plugin change the cursor from a touch-event callback? | 881 // FIXME: Can a plugin change the cursor from a touch-event callback? |
| 882 } | 882 } |
| 883 | 883 |
| 884 void WebPluginContainerImpl::SynthesizeMouseEventIfPossible(TouchEvent* event) { | 884 void WebPluginContainerImpl::SynthesizeMouseEventIfPossible(TouchEvent* event) { |
| 885 WebMouseEventBuilder web_event(this, LayoutItem(element_->GetLayoutObject()), | 885 WebMouseEventBuilder web_event( |
| 886 *event); | 886 ToFrameView(Parent()), LayoutItem(element_->GetLayoutObject()), *event); |
| 887 if (web_event.GetType() == WebInputEvent::kUndefined) | 887 if (web_event.GetType() == WebInputEvent::kUndefined) |
| 888 return; | 888 return; |
| 889 | 889 |
| 890 WebCursorInfo cursor_info; | 890 WebCursorInfo cursor_info; |
| 891 if (web_plugin_->HandleInputEvent(web_event, cursor_info) != | 891 if (web_plugin_->HandleInputEvent(web_event, cursor_info) != |
| 892 WebInputEventResult::kNotHandled) | 892 WebInputEventResult::kNotHandled) |
| 893 event->SetDefaultHandled(); | 893 event->SetDefaultHandled(); |
| 894 } | 894 } |
| 895 | 895 |
| 896 void WebPluginContainerImpl::FocusPlugin() { | 896 void WebPluginContainerImpl::FocusPlugin() { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 ComputeClipRectsForPlugin(element_, window_rect, clip_rect, | 995 ComputeClipRectsForPlugin(element_, window_rect, clip_rect, |
| 996 unobscured_rect); | 996 unobscured_rect); |
| 997 } | 997 } |
| 998 GetPluginOcclusions(element_, this->Parent(), FrameRect(), cut_out_rects); | 998 GetPluginOcclusions(element_, this->Parent(), FrameRect(), cut_out_rects); |
| 999 // Convert to the plugin position. | 999 // Convert to the plugin position. |
| 1000 for (size_t i = 0; i < cut_out_rects.size(); i++) | 1000 for (size_t i = 0; i < cut_out_rects.size(); i++) |
| 1001 cut_out_rects[i].Move(-FrameRect().X(), -FrameRect().Y()); | 1001 cut_out_rects[i].Move(-FrameRect().X(), -FrameRect().Y()); |
| 1002 } | 1002 } |
| 1003 | 1003 |
| 1004 } // namespace blink | 1004 } // namespace blink |
| OLD | NEW |