OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 gc.clip(dirtyRect); | 100 gc.clip(dirtyRect); |
101 view->paint(&gc, dirtyRect); | 101 view->paint(&gc, dirtyRect); |
102 if (overlays) | 102 if (overlays) |
103 overlays->paintWebFrame(gc); | 103 overlays->paintWebFrame(gc); |
104 } else { | 104 } else { |
105 gc.fillRect(dirtyRect, Color::white); | 105 gc.fillRect(dirtyRect, Color::white); |
106 } | 106 } |
107 gc.restore(); | 107 gc.restore(); |
108 } | 108 } |
109 | 109 |
110 bool PageWidgetDelegate::handleInputEvent(Page* page, PageWidgetEventHandler& ha
ndler, const WebInputEvent& event) | 110 bool PageWidgetDelegate::handleInputEvent(Page* page, PageWidgetEventHandler& ha
ndler, const WebInputEvent& event, bool canRubberbandLeft, bool canRubberbandRig
ht) |
111 { | 111 { |
112 LocalFrame* frame = page ? page->mainFrame() : 0; | 112 LocalFrame* frame = page ? page->mainFrame() : 0; |
113 switch (event.type) { | 113 switch (event.type) { |
114 | 114 |
115 // FIXME: WebKit seems to always return false on mouse events processing | 115 // FIXME: WebKit seems to always return false on mouse events processing |
116 // methods. For now we'll assume it has processed them (as we are only | 116 // methods. For now we'll assume it has processed them (as we are only |
117 // interested in whether keyboard events are processed). | 117 // interested in whether keyboard events are processed). |
118 case WebInputEvent::MouseMove: | 118 case WebInputEvent::MouseMove: |
119 if (!frame || !frame->view()) | 119 if (!frame || !frame->view()) |
120 return true; | 120 return true; |
(...skipping 11 matching lines...) Expand all Loading... |
132 return true; | 132 return true; |
133 case WebInputEvent::MouseUp: | 133 case WebInputEvent::MouseUp: |
134 if (!frame || !frame->view()) | 134 if (!frame || !frame->view()) |
135 return true; | 135 return true; |
136 handler.handleMouseUp(*frame, *static_cast<const WebMouseEvent*>(&event)
); | 136 handler.handleMouseUp(*frame, *static_cast<const WebMouseEvent*>(&event)
); |
137 return true; | 137 return true; |
138 | 138 |
139 case WebInputEvent::MouseWheel: | 139 case WebInputEvent::MouseWheel: |
140 if (!frame || !frame->view()) | 140 if (!frame || !frame->view()) |
141 return false; | 141 return false; |
142 return handler.handleMouseWheel(*frame, *static_cast<const WebMouseWheel
Event*>(&event)); | 142 return handler.handleMouseWheel(*frame, *static_cast<const WebMouseWheel
Event*>(&event), canRubberbandLeft, canRubberbandRight); |
143 | 143 |
144 case WebInputEvent::RawKeyDown: | 144 case WebInputEvent::RawKeyDown: |
145 case WebInputEvent::KeyDown: | 145 case WebInputEvent::KeyDown: |
146 case WebInputEvent::KeyUp: | 146 case WebInputEvent::KeyUp: |
147 return handler.handleKeyEvent(*static_cast<const WebKeyboardEvent*>(&eve
nt)); | 147 return handler.handleKeyEvent(*static_cast<const WebKeyboardEvent*>(&eve
nt)); |
148 | 148 |
149 case WebInputEvent::Char: | 149 case WebInputEvent::Char: |
150 return handler.handleCharEvent(*static_cast<const WebKeyboardEvent*>(&ev
ent)); | 150 return handler.handleCharEvent(*static_cast<const WebKeyboardEvent*>(&ev
ent)); |
151 case WebInputEvent::GestureScrollBegin: | 151 case WebInputEvent::GestureScrollBegin: |
152 case WebInputEvent::GestureScrollEnd: | 152 case WebInputEvent::GestureScrollEnd: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 void PageWidgetEventHandler::handleMouseDown(LocalFrame& mainFrame, const WebMou
seEvent& event) | 202 void PageWidgetEventHandler::handleMouseDown(LocalFrame& mainFrame, const WebMou
seEvent& event) |
203 { | 203 { |
204 mainFrame.eventHandler().handleMousePressEvent(PlatformMouseEventBuilder(mai
nFrame.view(), event)); | 204 mainFrame.eventHandler().handleMousePressEvent(PlatformMouseEventBuilder(mai
nFrame.view(), event)); |
205 } | 205 } |
206 | 206 |
207 void PageWidgetEventHandler::handleMouseUp(LocalFrame& mainFrame, const WebMouse
Event& event) | 207 void PageWidgetEventHandler::handleMouseUp(LocalFrame& mainFrame, const WebMouse
Event& event) |
208 { | 208 { |
209 mainFrame.eventHandler().handleMouseReleaseEvent(PlatformMouseEventBuilder(m
ainFrame.view(), event)); | 209 mainFrame.eventHandler().handleMouseReleaseEvent(PlatformMouseEventBuilder(m
ainFrame.view(), event)); |
210 } | 210 } |
211 | 211 |
212 bool PageWidgetEventHandler::handleMouseWheel(LocalFrame& mainFrame, const WebMo
useWheelEvent& event) | 212 bool PageWidgetEventHandler::handleMouseWheel(LocalFrame& mainFrame, const WebMo
useWheelEvent& event, bool canRubberbandLeft, bool canRubberbandRight) |
213 { | 213 { |
214 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event)); | 214 return mainFrame.eventHandler().handleWheelEvent(PlatformWheelEventBuilder(m
ainFrame.view(), event), canRubberbandLeft, canRubberbandRight); |
215 } | 215 } |
216 | 216 |
217 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) | 217 bool PageWidgetEventHandler::handleTouchEvent(LocalFrame& mainFrame, const WebTo
uchEvent& event) |
218 { | 218 { |
219 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); | 219 return mainFrame.eventHandler().handleTouchEvent(PlatformTouchEventBuilder(m
ainFrame.view(), event)); |
220 } | 220 } |
221 | 221 |
222 } | 222 } |
OLD | NEW |