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

Side by Side Diff: content/browser/renderer_host/web_input_event_factory_gtk.cc

Issue 19776016: Add files. Does not compile yet! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk links, may not work correctly Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/renderer_host/web_input_event_factory_gtk.h"
6
7 #include <gdk/gdk.h>
8 #include <gdk/gdkkeysyms.h>
9 #include <gtk/gtk.h>
10
11 #include "base/logging.h"
12 #include "third_party/WebKit/public/web/WebInputEvent.h"
13 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h"
14 #include "ui/base/keycodes/keyboard_code_conversion.h"
15
16 using WebKit::WebInputEvent;
17 using WebKit::WebMouseEvent;
18 using WebKit::WebMouseWheelEvent;
19 using WebKit::WebKeyboardEvent;
20
21 namespace {
22
23 // For click count tracking.
24 static int num_clicks = 0;
25 static GdkWindow* lack_click_event_window = 0;
26 static gint last_click_time = 0;
27 static gint last_click_x = 0;
28 static gint last_click_y = 0;
29 static WebMouseEvent::Button last_click_button = WebMouseEvent::ButtonNone;
30
31 bool ShouldForgetPreviousClick(GdkWindow* window, gint time, gint x, gint y) {
32 static GtkSettings* settings = gtk_settings_get_default();
33
34 if (window != lack_click_event_window)
35 return true;
36
37 gint double_click_time = 250;
38 gint double_click_distance = 5;
39 g_object_get(G_OBJECT(settings),
40 "gtk-double-click-time",
41 &double_click_time,
42 "gtk-double-click-distance",
43 &double_click_distance,
44 NULL);
45 return (time - last_click_time) > double_click_time ||
46 abs(x - last_click_x) > double_click_distance ||
47 abs(y - last_click_y) > double_click_distance;
48 }
49
50 void ResetClickCountState() {
51 num_clicks = 0;
52 lack_click_event_window = 0;
53 last_click_time = 0;
54 last_click_x = 0;
55 last_click_y = 0;
56 last_click_button = WebKit::WebMouseEvent::ButtonNone;
57 }
58
59 bool IsKeyPadKeyval(guint keyval) {
60 // Keypad keyvals all fall into one range.
61 return keyval >= GDK_KP_Space && keyval <= GDK_KP_9;
62 }
63
64 double GdkEventTimeToWebEventTime(guint32 time) {
65 // Convert from time in ms to time in sec.
66 return time / 1000.0;
67 }
68
69 int GdkStateToWebEventModifiers(guint state) {
70 int modifiers = 0;
71 if (state & GDK_SHIFT_MASK)
72 modifiers |= WebInputEvent::ShiftKey;
73 if (state & GDK_CONTROL_MASK)
74 modifiers |= WebInputEvent::ControlKey;
75 if (state & GDK_MOD1_MASK)
76 modifiers |= WebInputEvent::AltKey;
77 if (state & GDK_META_MASK)
78 modifiers |= WebInputEvent::MetaKey;
79 if (state & GDK_BUTTON1_MASK)
80 modifiers |= WebInputEvent::LeftButtonDown;
81 if (state & GDK_BUTTON2_MASK)
82 modifiers |= WebInputEvent::MiddleButtonDown;
83 if (state & GDK_BUTTON3_MASK)
84 modifiers |= WebInputEvent::RightButtonDown;
85 if (state & GDK_LOCK_MASK)
86 modifiers |= WebInputEvent::CapsLockOn;
87 if (state & GDK_MOD2_MASK)
88 modifiers |= WebInputEvent::NumLockOn;
89 return modifiers;
90 }
91
92 ui::KeyboardCode GdkEventToWindowsKeyCode(const GdkEventKey* event) {
93 return ui::WindowsKeyCodeForGdkKeyCode(event->keyval);
94 /*
95 static const unsigned int hardwareCodeToGDKKeyval[] = {
96 0, // 0x00:
97 0, // 0x01:
98 0, // 0x02:
99 0, // 0x03:
100 0, // 0x04:
101 0, // 0x05:
102 0, // 0x06:
103 0, // 0x07:
104 0, // 0x08:
105 0, // 0x09: GDK_Escape
106 GDK_1, // 0x0A: GDK_1
107 GDK_2, // 0x0B: GDK_2
108 GDK_3, // 0x0C: GDK_3
109 GDK_4, // 0x0D: GDK_4
110 GDK_5, // 0x0E: GDK_5
111 GDK_6, // 0x0F: GDK_6
112 GDK_7, // 0x10: GDK_7
113 GDK_8, // 0x11: GDK_8
114 GDK_9, // 0x12: GDK_9
115 GDK_0, // 0x13: GDK_0
116 GDK_minus, // 0x14: GDK_minus
117 GDK_equal, // 0x15: GDK_equal
118 0, // 0x16: GDK_BackSpace
119 0, // 0x17: GDK_Tab
120 GDK_q, // 0x18: GDK_q
121 GDK_w, // 0x19: GDK_w
122 GDK_e, // 0x1A: GDK_e
123 GDK_r, // 0x1B: GDK_r
124 GDK_t, // 0x1C: GDK_t
125 GDK_y, // 0x1D: GDK_y
126 GDK_u, // 0x1E: GDK_u
127 GDK_i, // 0x1F: GDK_i
128 GDK_o, // 0x20: GDK_o
129 GDK_p, // 0x21: GDK_p
130 GDK_bracketleft, // 0x22: GDK_bracketleft
131 GDK_bracketright, // 0x23: GDK_bracketright
132 0, // 0x24: GDK_Return
133 0, // 0x25: GDK_Control_L
134 GDK_a, // 0x26: GDK_a
135 GDK_s, // 0x27: GDK_s
136 GDK_d, // 0x28: GDK_d
137 GDK_f, // 0x29: GDK_f
138 GDK_g, // 0x2A: GDK_g
139 GDK_h, // 0x2B: GDK_h
140 GDK_j, // 0x2C: GDK_j
141 GDK_k, // 0x2D: GDK_k
142 GDK_l, // 0x2E: GDK_l
143 GDK_semicolon, // 0x2F: GDK_semicolon
144 GDK_apostrophe, // 0x30: GDK_apostrophe
145 GDK_grave, // 0x31: GDK_grave
146 0, // 0x32: GDK_Shift_L
147 GDK_backslash, // 0x33: GDK_backslash
148 GDK_z, // 0x34: GDK_z
149 GDK_x, // 0x35: GDK_x
150 GDK_c, // 0x36: GDK_c
151 GDK_v, // 0x37: GDK_v
152 GDK_b, // 0x38: GDK_b
153 GDK_n, // 0x39: GDK_n
154 GDK_m, // 0x3A: GDK_m
155 GDK_comma, // 0x3B: GDK_comma
156 GDK_period, // 0x3C: GDK_period
157 GDK_slash, // 0x3D: GDK_slash
158 0, // 0x3E: GDK_Shift_R
159 0, // 0x3F:
160 0, // 0x40:
161 0, // 0x41:
162 0, // 0x42:
163 0, // 0x43:
164 0, // 0x44:
165 0, // 0x45:
166 0, // 0x46:
167 0, // 0x47:
168 0, // 0x48:
169 0, // 0x49:
170 0, // 0x4A:
171 0, // 0x4B:
172 0, // 0x4C:
173 0, // 0x4D:
174 0, // 0x4E:
175 0, // 0x4F:
176 0, // 0x50:
177 0, // 0x51:
178 0, // 0x52:
179 0, // 0x53:
180 0, // 0x54:
181 0, // 0x55:
182 0, // 0x56:
183 0, // 0x57:
184 0, // 0x58:
185 0, // 0x59:
186 0, // 0x5A:
187 0, // 0x5B:
188 0, // 0x5C:
189 0, // 0x5D:
190 0, // 0x5E:
191 0, // 0x5F:
192 0, // 0x60:
193 0, // 0x61:
194 0, // 0x62:
195 0, // 0x63:
196 0, // 0x64:
197 0, // 0x65:
198 0, // 0x66:
199 0, // 0x67:
200 0, // 0x68:
201 0, // 0x69:
202 0, // 0x6A:
203 0, // 0x6B:
204 0, // 0x6C:
205 0, // 0x6D:
206 0, // 0x6E:
207 0, // 0x6F:
208 0, // 0x70:
209 0, // 0x71:
210 0, // 0x72:
211 GDK_Super_L, // 0x73: GDK_Super_L
212 GDK_Super_R, // 0x74: GDK_Super_R
213 };
214
215 // |windowsKeyCode| has to include a valid virtual-key code even when we
216 // use non-US layouts, e.g. even when we type an 'A' key of a US keyboard
217 // on the Hebrew layout, |windowsKeyCode| should be VK_A.
218 // On the other hand, |event->keyval| value depends on the current
219 // GdkKeymap object, i.e. when we type an 'A' key of a US keyboard on
220 // the Hebrew layout, |event->keyval| becomes GDK_hebrew_shin and this
221 // WebCore::windowsKeyCodeForKeyEvent() call returns 0.
222 // To improve compatibilty with Windows, we use |event->hardware_keycode|
223 // for retrieving its Windows key-code for the keys when the
224 // WebCore::windowsKeyCodeForEvent() call returns 0.
225 // We shouldn't use |event->hardware_keycode| for keys that GdkKeymap
226 // objects cannot change because |event->hardware_keycode| doesn't change
227 // even when we change the layout options, e.g. when we swap a control
228 // key and a caps-lock key, GTK doesn't swap their
229 // |event->hardware_keycode| values but swap their |event->keyval| values.
230 int windowsKeyCode = WebCore::windowsKeyCodeForKeyEvent(event->keyval);
231 if (windowsKeyCode)
232 return windowsKeyCode;
233
234 const int tableSize =
235 sizeof(hardwareCodeToGDKKeyval) / sizeof(hardwareCodeToGDKKeyval[0]);
236 if (event->hardware_keycode < tableSize) {
237 int keyval = hardwareCodeToGDKKeyval[event->hardware_keycode];
238 if (keyval)
239 return WebCore::windowsKeyCodeForKeyEvent(keyval);
240 }
241
242 // This key is one that keyboard-layout drivers cannot change.
243 // Use |event->keyval| to retrieve its |windowsKeyCode| value.
244 return WebCore::windowsKeyCodeForKeyEvent(event->keyval);
245 */
246 }
247
248 // Normalizes event->state to make it Windows/Mac compatible. Since the way
249 // of setting modifier mask on X is very different than Windows/Mac as shown
250 // in http://crbug.com/127142#c8, the normalization is necessary.
251 guint NormalizeEventState(const GdkEventKey* event) {
252 guint mask = 0;
253 switch (GdkEventToWindowsKeyCode(event)) {
254 case ui::VKEY_CONTROL:
255 case ui::VKEY_LCONTROL:
256 case ui::VKEY_RCONTROL:
257 mask = GDK_CONTROL_MASK;
258 break;
259 case ui::VKEY_SHIFT:
260 case ui::VKEY_LSHIFT:
261 case ui::VKEY_RSHIFT:
262 mask = GDK_SHIFT_MASK;
263 break;
264 case ui::VKEY_MENU:
265 case ui::VKEY_LMENU:
266 case ui::VKEY_RMENU:
267 mask = GDK_MOD1_MASK;
268 break;
269 case ui::VKEY_CAPITAL:
270 mask = GDK_LOCK_MASK;
271 break;
272 default:
273 return event->state;
274 }
275 if (event->type == GDK_KEY_PRESS)
276 return event->state | mask;
277 return event->state & ~mask;
278 }
279
280 // Gets the corresponding control character of a specified key code. See:
281 // http://en.wikipedia.org/wiki/Control_characters
282 // We emulate Windows behavior here.
283 int GetControlCharacter(ui::KeyboardCode windows_key_code, bool shift) {
284 if (windows_key_code >= ui::VKEY_A && windows_key_code <= ui::VKEY_Z) {
285 // ctrl-A ~ ctrl-Z map to \x01 ~ \x1A
286 return windows_key_code - ui::VKEY_A + 1;
287 }
288 if (shift) {
289 // following graphics chars require shift key to input.
290 switch (windows_key_code) {
291 // ctrl-@ maps to \x00 (Null byte)
292 case ui::VKEY_2:
293 return 0;
294 // ctrl-^ maps to \x1E (Record separator, Information separator two)
295 case ui::VKEY_6:
296 return 0x1E;
297 // ctrl-_ maps to \x1F (Unit separator, Information separator one)
298 case ui::VKEY_OEM_MINUS:
299 return 0x1F;
300 // Returns 0 for all other keys to avoid inputting unexpected chars.
301 default:
302 return 0;
303 }
304 } else {
305 switch (windows_key_code) {
306 // ctrl-[ maps to \x1B (Escape)
307 case ui::VKEY_OEM_4:
308 return 0x1B;
309 // ctrl-\ maps to \x1C (File separator, Information separator four)
310 case ui::VKEY_OEM_5:
311 return 0x1C;
312 // ctrl-] maps to \x1D (Group separator, Information separator three)
313 case ui::VKEY_OEM_6:
314 return 0x1D;
315 // ctrl-Enter maps to \x0A (Line feed)
316 case ui::VKEY_RETURN:
317 return 0x0A;
318 // Returns 0 for all other keys to avoid inputting unexpected chars.
319 default:
320 return 0;
321 }
322 }
323 }
324
325 } // namespace
326
327 namespace content {
328
329 // WebKeyboardEvent -----------------------------------------------------------
330
331 WebKeyboardEvent WebInputEventFactory::keyboardEvent(const GdkEventKey* event) {
332 WebKeyboardEvent result;
333
334 result.timeStampSeconds = GdkEventTimeToWebEventTime(event->time);
335 result.modifiers = GdkStateToWebEventModifiers(NormalizeEventState(event));
336
337 switch (event->type) {
338 case GDK_KEY_RELEASE:
339 result.type = WebInputEvent::KeyUp;
340 break;
341 case GDK_KEY_PRESS:
342 result.type = WebInputEvent::RawKeyDown;
343 break;
344 default:
345 NOTREACHED();
346 }
347
348 // According to MSDN:
349 // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx
350 // Key events with Alt modifier and F10 are system key events.
351 // We just emulate this behavior. It's necessary to prevent webkit from
352 // processing keypress event generated by alt-d, etc.
353 // F10 is not special on Linux, so don't treat it as system key.
354 if (result.modifiers & WebInputEvent::AltKey)
355 result.isSystemKey = true;
356
357 // The key code tells us which physical key was pressed (for example, the
358 // A key went down or up). It does not determine whether A should be lower
359 // or upper case. This is what text does, which should be the keyval.
360 ui::KeyboardCode windows_key_code = GdkEventToWindowsKeyCode(event);
361 result.windowsKeyCode =
362 ui::GetWindowsKeyCodeWithoutLocation(windows_key_code);
363 result.modifiers |=
364 ui::GetLocationModifiersFromWindowsKeyCode(windows_key_code);
365 result.nativeKeyCode = event->hardware_keycode;
366
367 if (result.windowsKeyCode == ui::VKEY_RETURN) {
368 // We need to treat the enter key as a key press of character \r. This
369 // is apparently just how webkit handles it and what it expects.
370 result.unmodifiedText[0] = '\r';
371 } else {
372 // FIXME: fix for non BMP chars
373 result.unmodifiedText[0] =
374 static_cast<int>(gdk_keyval_to_unicode(event->keyval));
375 }
376
377 // If ctrl key is pressed down, then control character shall be input.
378 if (result.modifiers & WebInputEvent::ControlKey) {
379 result.text[0] =
380 GetControlCharacter(ui::KeyboardCode(result.windowsKeyCode),
381 result.modifiers & WebInputEvent::ShiftKey);
382 } else {
383 result.text[0] = result.unmodifiedText[0];
384 }
385
386 result.setKeyIdentifierFromWindowsKeyCode();
387
388 // FIXME: Do we need to set IsAutoRepeat?
389 if (IsKeyPadKeyval(event->keyval))
390 result.modifiers |= WebInputEvent::IsKeyPad;
391
392 return result;
393 }
394
395 WebKeyboardEvent WebInputEventFactory::keyboardEvent(wchar_t character,
396 int state,
397 double timeStampSeconds) {
398 // keyboardEvent(const GdkEventKey*) depends on the GdkEventKey object and
399 // it is hard to use/ it from signal handlers which don't use GdkEventKey
400 // objects (e.g. GtkIMContext signal handlers.) For such handlers, this
401 // function creates a WebInputEvent::Char event without using a
402 // GdkEventKey object.
403 WebKeyboardEvent result;
404 result.type = WebKit::WebInputEvent::Char;
405 result.timeStampSeconds = timeStampSeconds;
406 result.modifiers = GdkStateToWebEventModifiers(state);
407 result.windowsKeyCode = character;
408 result.nativeKeyCode = character;
409 result.text[0] = character;
410 result.unmodifiedText[0] = character;
411
412 // According to MSDN:
413 // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx
414 // Key events with Alt modifier and F10 are system key events.
415 // We just emulate this behavior. It's necessary to prevent webkit from
416 // processing keypress event generated by alt-d, etc.
417 // F10 is not special on Linux, so don't treat it as system key.
418 if (result.modifiers & WebInputEvent::AltKey)
419 result.isSystemKey = true;
420
421 return result;
422 }
423
424 // WebMouseEvent --------------------------------------------------------------
425
426 WebMouseEvent WebInputEventFactory::mouseEvent(const GdkEventButton* event) {
427 WebMouseEvent result;
428
429 result.timeStampSeconds = GdkEventTimeToWebEventTime(event->time);
430
431 result.modifiers = GdkStateToWebEventModifiers(event->state);
432 result.x = static_cast<int>(event->x);
433 result.y = static_cast<int>(event->y);
434 result.windowX = result.x;
435 result.windowY = result.y;
436 result.globalX = static_cast<int>(event->x_root);
437 result.globalY = static_cast<int>(event->y_root);
438 result.clickCount = 0;
439
440 switch (event->type) {
441 case GDK_BUTTON_PRESS:
442 result.type = WebInputEvent::MouseDown;
443 break;
444 case GDK_BUTTON_RELEASE:
445 result.type = WebInputEvent::MouseUp;
446 break;
447 case GDK_3BUTTON_PRESS:
448 case GDK_2BUTTON_PRESS:
449 default:
450 NOTREACHED();
451 }
452
453 result.button = WebMouseEvent::ButtonNone;
454 if (event->button == 1)
455 result.button = WebMouseEvent::ButtonLeft;
456 else if (event->button == 2)
457 result.button = WebMouseEvent::ButtonMiddle;
458 else if (event->button == 3)
459 result.button = WebMouseEvent::ButtonRight;
460
461 if (result.type == WebInputEvent::MouseDown) {
462 bool forgetPreviousClick = ShouldForgetPreviousClick(
463 event->window, event->time, event->x, event->y);
464
465 if (!forgetPreviousClick && result.button == last_click_button)
466 ++num_clicks;
467 else {
468 num_clicks = 1;
469
470 lack_click_event_window = event->window;
471 last_click_x = event->x;
472 last_click_y = event->y;
473 last_click_button = result.button;
474 }
475 last_click_time = event->time;
476 }
477 result.clickCount = num_clicks;
478
479 return result;
480 }
481
482 WebMouseEvent WebInputEventFactory::mouseEvent(const GdkEventMotion* event) {
483 WebMouseEvent result;
484
485 result.timeStampSeconds = GdkEventTimeToWebEventTime(event->time);
486 result.modifiers = GdkStateToWebEventModifiers(event->state);
487 result.x = static_cast<int>(event->x);
488 result.y = static_cast<int>(event->y);
489 result.windowX = result.x;
490 result.windowY = result.y;
491 result.globalX = static_cast<int>(event->x_root);
492 result.globalY = static_cast<int>(event->y_root);
493
494 switch (event->type) {
495 case GDK_MOTION_NOTIFY:
496 result.type = WebInputEvent::MouseMove;
497 break;
498 default:
499 NOTREACHED();
500 }
501
502 result.button = WebMouseEvent::ButtonNone;
503 if (event->state & GDK_BUTTON1_MASK)
504 result.button = WebMouseEvent::ButtonLeft;
505 else if (event->state & GDK_BUTTON2_MASK)
506 result.button = WebMouseEvent::ButtonMiddle;
507 else if (event->state & GDK_BUTTON3_MASK)
508 result.button = WebMouseEvent::ButtonRight;
509
510 if (ShouldForgetPreviousClick(event->window, event->time, event->x, event->y))
511 ResetClickCountState();
512
513 return result;
514 }
515
516 WebMouseEvent WebInputEventFactory::mouseEvent(const GdkEventCrossing* event) {
517 WebMouseEvent result;
518
519 result.timeStampSeconds = GdkEventTimeToWebEventTime(event->time);
520 result.modifiers = GdkStateToWebEventModifiers(event->state);
521 result.x = static_cast<int>(event->x);
522 result.y = static_cast<int>(event->y);
523 result.windowX = result.x;
524 result.windowY = result.y;
525 result.globalX = static_cast<int>(event->x_root);
526 result.globalY = static_cast<int>(event->y_root);
527
528 switch (event->type) {
529 case GDK_ENTER_NOTIFY:
530 case GDK_LEAVE_NOTIFY:
531 // Note that if we sent MouseEnter or MouseLeave to WebKit, it
532 // wouldn't work - they don't result in the proper JavaScript events.
533 // MouseMove does the right thing.
534 result.type = WebInputEvent::MouseMove;
535 break;
536 default:
537 NOTREACHED();
538 }
539
540 result.button = WebMouseEvent::ButtonNone;
541 if (event->state & GDK_BUTTON1_MASK)
542 result.button = WebMouseEvent::ButtonLeft;
543 else if (event->state & GDK_BUTTON2_MASK)
544 result.button = WebMouseEvent::ButtonMiddle;
545 else if (event->state & GDK_BUTTON3_MASK)
546 result.button = WebMouseEvent::ButtonRight;
547
548 if (ShouldForgetPreviousClick(event->window, event->time, event->x, event->y))
549 ResetClickCountState();
550
551 return result;
552 }
553
554 // WebMouseWheelEvent ---------------------------------------------------------
555
556 WebMouseWheelEvent WebInputEventFactory::mouseWheelEvent(
557 const GdkEventScroll* event) {
558 WebMouseWheelEvent result;
559
560 result.type = WebInputEvent::MouseWheel;
561 result.button = WebMouseEvent::ButtonNone;
562
563 result.timeStampSeconds = GdkEventTimeToWebEventTime(event->time);
564 result.modifiers = GdkStateToWebEventModifiers(event->state);
565 result.x = static_cast<int>(event->x);
566 result.y = static_cast<int>(event->y);
567 result.windowX = result.x;
568 result.windowY = result.y;
569 result.globalX = static_cast<int>(event->x_root);
570 result.globalY = static_cast<int>(event->y_root);
571
572 // How much should we scroll per mouse wheel event?
573 // - Windows uses 3 lines by default and obeys a system setting.
574 // - Mozilla has a pref that lets you either use the "system" number of lines
575 // to scroll, or lets the user override it.
576 // For the "system" number of lines, it appears they've hardcoded 3.
577 // See case NS_MOUSE_SCROLL in content/events/src/nsEventStateManager.cpp
578 // and InitMouseScrollEvent in widget/src/gtk2/nsCommonWidget.cpp .
579 // - Gtk makes the scroll amount a function of the size of the scroll bar,
580 // which is not available to us here.
581 // Instead, we pick a number that empirically matches Firefox's behavior.
582 static const float scrollbarPixelsPerTick = 160.0f / 3.0f;
583
584 switch (event->direction) {
585 case GDK_SCROLL_UP:
586 result.deltaY = scrollbarPixelsPerTick;
587 result.wheelTicksY = 1;
588 break;
589 case GDK_SCROLL_DOWN:
590 result.deltaY = -scrollbarPixelsPerTick;
591 result.wheelTicksY = -1;
592 break;
593 case GDK_SCROLL_LEFT:
594 result.deltaX = scrollbarPixelsPerTick;
595 result.wheelTicksX = 1;
596 break;
597 case GDK_SCROLL_RIGHT:
598 result.deltaX = -scrollbarPixelsPerTick;
599 result.wheelTicksX = -1;
600 break;
601 }
602
603 return result;
604 }
605
606 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698