| 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 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1796 GetSelectionController().SendContextMenuEvent(mev, position_in_contents); | 1796 GetSelectionController().SendContextMenuEvent(mev, position_in_contents); |
| 1797 | 1797 |
| 1798 Node* target_node = | 1798 Node* target_node = |
| 1799 override_target_node ? override_target_node : mev.InnerNode(); | 1799 override_target_node ? override_target_node : mev.InnerNode(); |
| 1800 return mouse_event_manager_->DispatchMouseEvent( | 1800 return mouse_event_manager_->DispatchMouseEvent( |
| 1801 UpdateMouseEventTargetNode(target_node), EventTypeNames::contextmenu, | 1801 UpdateMouseEventTargetNode(target_node), EventTypeNames::contextmenu, |
| 1802 event, mev.GetHitTestResult().CanvasRegionId(), 0); | 1802 event, mev.GetHitTestResult().CanvasRegionId(), 0); |
| 1803 } | 1803 } |
| 1804 | 1804 |
| 1805 WebInputEventResult EventHandler::SendContextMenuEventForKey( | 1805 WebInputEventResult EventHandler::SendContextMenuEventForKey( |
| 1806 Element* override_target_element) { | 1806 Element* override_target_element, |
| 1807 WebMenuSourceType source_type) { |
| 1807 FrameView* view = frame_->View(); | 1808 FrameView* view = frame_->View(); |
| 1808 if (!view) | 1809 if (!view) |
| 1809 return WebInputEventResult::kNotHandled; | 1810 return WebInputEventResult::kNotHandled; |
| 1810 | 1811 |
| 1811 Document* doc = frame_->GetDocument(); | 1812 Document* doc = frame_->GetDocument(); |
| 1812 if (!doc) | 1813 if (!doc) |
| 1813 return WebInputEventResult::kNotHandled; | 1814 return WebInputEventResult::kNotHandled; |
| 1814 | 1815 |
| 1815 static const int kContextMenuMargin = 1; | 1816 static const int kContextMenuMargin = 1; |
| 1816 | 1817 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1882 WebInputEvent::Type event_type = WebInputEvent::kMouseDown; | 1883 WebInputEvent::Type event_type = WebInputEvent::kMouseDown; |
| 1883 if (frame_->GetSettings() && | 1884 if (frame_->GetSettings() && |
| 1884 frame_->GetSettings()->GetShowContextMenuOnMouseUp()) | 1885 frame_->GetSettings()->GetShowContextMenuOnMouseUp()) |
| 1885 event_type = WebInputEvent::kMouseUp; | 1886 event_type = WebInputEvent::kMouseUp; |
| 1886 | 1887 |
| 1887 WebMouseEvent mouse_event( | 1888 WebMouseEvent mouse_event( |
| 1888 event_type, | 1889 event_type, |
| 1889 WebFloatPoint(location_in_root_frame.X(), location_in_root_frame.Y()), | 1890 WebFloatPoint(location_in_root_frame.X(), location_in_root_frame.Y()), |
| 1890 WebFloatPoint(global_position.X(), global_position.Y()), | 1891 WebFloatPoint(global_position.X(), global_position.Y()), |
| 1891 WebPointerProperties::Button::kNoButton, /* clickCount */ 0, | 1892 WebPointerProperties::Button::kNoButton, /* clickCount */ 0, |
| 1892 WebInputEvent::kNoModifiers, TimeTicks::Now().InSeconds()); | 1893 ((source_type == kMenuSourceTouchHandle) |
| 1894 ? WebInputEvent::kIsCompatibilityEventForTouch |
| 1895 : WebInputEvent::kNoModifiers), |
| 1896 TimeTicks::Now().InSeconds()); |
| 1893 | 1897 |
| 1894 // TODO(dtapuska): Transition the mouseEvent to be created really in viewport | 1898 // TODO(dtapuska): Transition the mouseEvent to be created really in viewport |
| 1895 // coordinates instead of root frame coordinates. | 1899 // coordinates instead of root frame coordinates. |
| 1896 mouse_event.SetFrameScale(1); | 1900 mouse_event.SetFrameScale(1); |
| 1897 | 1901 |
| 1898 return SendContextMenuEvent(mouse_event, override_target_element); | 1902 return SendContextMenuEvent(mouse_event, override_target_element); |
| 1899 } | 1903 } |
| 1900 | 1904 |
| 1901 void EventHandler::ScheduleHoverStateUpdate() { | 1905 void EventHandler::ScheduleHoverStateUpdate() { |
| 1902 // TODO(https://crbug.com/668758): Use a normal BeginFrame update for this. | 1906 // 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... |
| 2119 MouseEventWithHitTestResults& mev, | 2123 MouseEventWithHitTestResults& mev, |
| 2120 LocalFrame* subframe) { | 2124 LocalFrame* subframe) { |
| 2121 WebInputEventResult result = | 2125 WebInputEventResult result = |
| 2122 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); | 2126 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); |
| 2123 if (result != WebInputEventResult::kNotHandled) | 2127 if (result != WebInputEventResult::kNotHandled) |
| 2124 return result; | 2128 return result; |
| 2125 return WebInputEventResult::kHandledSystem; | 2129 return WebInputEventResult::kHandledSystem; |
| 2126 } | 2130 } |
| 2127 | 2131 |
| 2128 } // namespace blink | 2132 } // namespace blink |
| OLD | NEW |