| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1794 GetSelectionController().SendContextMenuEvent(mev, position_in_contents); | 1794 GetSelectionController().SendContextMenuEvent(mev, position_in_contents); |
| 1795 | 1795 |
| 1796 Node* target_node = | 1796 Node* target_node = |
| 1797 override_target_node ? override_target_node : mev.InnerNode(); | 1797 override_target_node ? override_target_node : mev.InnerNode(); |
| 1798 return mouse_event_manager_->DispatchMouseEvent( | 1798 return mouse_event_manager_->DispatchMouseEvent( |
| 1799 UpdateMouseEventTargetNode(target_node), EventTypeNames::contextmenu, | 1799 UpdateMouseEventTargetNode(target_node), EventTypeNames::contextmenu, |
| 1800 event, mev.GetHitTestResult().CanvasRegionId(), 0); | 1800 event, mev.GetHitTestResult().CanvasRegionId(), 0); |
| 1801 } | 1801 } |
| 1802 | 1802 |
| 1803 WebInputEventResult EventHandler::SendContextMenuEventForKey( | 1803 WebInputEventResult EventHandler::SendContextMenuEventForKey( |
| 1804 Element* override_target_element) { | 1804 Element* override_target_element, |
| 1805 bool from_touch_handle) { |
| 1805 FrameView* view = frame_->View(); | 1806 FrameView* view = frame_->View(); |
| 1806 if (!view) | 1807 if (!view) |
| 1807 return WebInputEventResult::kNotHandled; | 1808 return WebInputEventResult::kNotHandled; |
| 1808 | 1809 |
| 1809 Document* doc = frame_->GetDocument(); | 1810 Document* doc = frame_->GetDocument(); |
| 1810 if (!doc) | 1811 if (!doc) |
| 1811 return WebInputEventResult::kNotHandled; | 1812 return WebInputEventResult::kNotHandled; |
| 1812 | 1813 |
| 1813 static const int kContextMenuMargin = 1; | 1814 static const int kContextMenuMargin = 1; |
| 1814 | 1815 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1880 WebInputEvent::Type event_type = WebInputEvent::kMouseDown; | 1881 WebInputEvent::Type event_type = WebInputEvent::kMouseDown; |
| 1881 if (frame_->GetSettings() && | 1882 if (frame_->GetSettings() && |
| 1882 frame_->GetSettings()->GetShowContextMenuOnMouseUp()) | 1883 frame_->GetSettings()->GetShowContextMenuOnMouseUp()) |
| 1883 event_type = WebInputEvent::kMouseUp; | 1884 event_type = WebInputEvent::kMouseUp; |
| 1884 | 1885 |
| 1885 WebMouseEvent mouse_event( | 1886 WebMouseEvent mouse_event( |
| 1886 event_type, | 1887 event_type, |
| 1887 WebFloatPoint(location_in_root_frame.X(), location_in_root_frame.Y()), | 1888 WebFloatPoint(location_in_root_frame.X(), location_in_root_frame.Y()), |
| 1888 WebFloatPoint(global_position.X(), global_position.Y()), | 1889 WebFloatPoint(global_position.X(), global_position.Y()), |
| 1889 WebPointerProperties::Button::kNoButton, /* clickCount */ 0, | 1890 WebPointerProperties::Button::kNoButton, /* clickCount */ 0, |
| 1890 WebInputEvent::kNoModifiers, TimeTicks::Now().InSeconds()); | 1891 (from_touch_handle ? WebInputEvent::kIsCompatibilityEventForTouch |
| 1892 : WebInputEvent::kNoModifiers), |
| 1893 TimeTicks::Now().InSeconds()); |
| 1891 | 1894 |
| 1892 // TODO(dtapuska): Transition the mouseEvent to be created really in viewport | 1895 // TODO(dtapuska): Transition the mouseEvent to be created really in viewport |
| 1893 // coordinates instead of root frame coordinates. | 1896 // coordinates instead of root frame coordinates. |
| 1894 mouse_event.SetFrameScale(1); | 1897 mouse_event.SetFrameScale(1); |
| 1895 | 1898 |
| 1896 return SendContextMenuEvent(mouse_event, override_target_element); | 1899 return SendContextMenuEvent(mouse_event, override_target_element); |
| 1897 } | 1900 } |
| 1898 | 1901 |
| 1899 void EventHandler::ScheduleHoverStateUpdate() { | 1902 void EventHandler::ScheduleHoverStateUpdate() { |
| 1900 // TODO(https://crbug.com/668758): Use a normal BeginFrame update for this. | 1903 // TODO(https://crbug.com/668758): Use a normal BeginFrame update for this. |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2117 MouseEventWithHitTestResults& mev, | 2120 MouseEventWithHitTestResults& mev, |
| 2118 LocalFrame* subframe) { | 2121 LocalFrame* subframe) { |
| 2119 WebInputEventResult result = | 2122 WebInputEventResult result = |
| 2120 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); | 2123 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); |
| 2121 if (result != WebInputEventResult::kNotHandled) | 2124 if (result != WebInputEventResult::kNotHandled) |
| 2122 return result; | 2125 return result; |
| 2123 return WebInputEventResult::kHandledSystem; | 2126 return WebInputEventResult::kHandledSystem; |
| 2124 } | 2127 } |
| 2125 | 2128 |
| 2126 } // namespace blink | 2129 } // namespace blink |
| OLD | NEW |