Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 2650403006: Remove PlatformMouseEvent and use WebMouseEvent instead (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 PluginView::trace(visitor); 699 PluginView::trace(visitor);
700 } 700 }
701 701
702 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) { 702 void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) {
703 DCHECK(parent()->isFrameView()); 703 DCHECK(parent()->isFrameView());
704 704
705 // We cache the parent FrameView here as the plugin widget could be deleted 705 // We cache the parent FrameView here as the plugin widget could be deleted
706 // in the call to HandleEvent. See http://b/issue?id=1362948 706 // in the call to HandleEvent. See http://b/issue?id=1362948
707 FrameView* parentView = toFrameView(parent()); 707 FrameView* parentView = toFrameView(parent());
708 708
709 WebMouseEventBuilder webEvent(this, LayoutItem(m_element->layoutObject()), 709 WebMouseEventBuilder transformedEvent(
710 *event); 710 this, LayoutItem(m_element->layoutObject()), *event);
711 if (webEvent.type() == WebInputEvent::Undefined) 711 if (transformedEvent.type() == WebInputEvent::Undefined)
712 return; 712 return;
713 713
714 if (event->type() == EventTypeNames::mousedown) 714 if (event->type() == EventTypeNames::mousedown)
715 focusPlugin(); 715 focusPlugin();
716 716
717 WebCursorInfo cursorInfo; 717 WebCursorInfo cursorInfo;
718 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo) != 718 if (m_webPlugin->handleInputEvent(transformedEvent, cursorInfo) !=
719 WebInputEventResult::NotHandled) 719 WebInputEventResult::NotHandled)
720 event->setDefaultHandled(); 720 event->setDefaultHandled();
721 721
722 // A windowless plugin can change the cursor in response to a mouse move 722 // A windowless plugin can change the cursor in response to a mouse move
723 // event. We need to reflect the changed cursor in the frame view as the 723 // event. We need to reflect the changed cursor in the frame view as the
724 // mouse is moved in the boundaries of the windowless plugin. 724 // mouse is moved in the boundaries of the windowless plugin.
725 Page* page = parentView->frame().page(); 725 Page* page = parentView->frame().page();
726 if (!page) 726 if (!page)
727 return; 727 return;
728 toChromeClientImpl(page->chromeClient()) 728 toChromeClientImpl(page->chromeClient())
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 // frame view. 983 // frame view.
984 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); 984 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect);
985 } 985 }
986 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 986 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
987 // Convert to the plugin position. 987 // Convert to the plugin position.
988 for (size_t i = 0; i < cutOutRects.size(); i++) 988 for (size_t i = 0; i < cutOutRects.size(); i++)
989 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 989 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
990 } 990 }
991 991
992 } // namespace blink 992 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698