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

Side by Side Diff: public/web/WebInputEvent.h

Issue 1308313005: Modify gesture event types for WebView-tag scroll bubbling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comment to explain |resendingPluginId|. Created 5 years, 3 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
« no previous file with comments | « Source/web/tests/WebInputEventConversionTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 }; 366 };
367 367
368 float deltaX; 368 float deltaX;
369 float deltaY; 369 float deltaY;
370 float wheelTicksX; 370 float wheelTicksX;
371 float wheelTicksY; 371 float wheelTicksY;
372 372
373 float accelerationRatioX; 373 float accelerationRatioX;
374 float accelerationRatioY; 374 float accelerationRatioY;
375 375
376 // This field exists to allow BrowserPlugin to mark MouseWheel events as
377 // 'resent' to handle the case where an event is not consumed when first
378 // encountered; it should be handled differently by the plugin when it is
379 // sent for thesecond time. No code within Blink touches this, other than to
380 // plumb it through event conversions.
381 int resendingPluginId;
382
376 Phase phase; 383 Phase phase;
377 Phase momentumPhase; 384 Phase momentumPhase;
378 385
379 // Rubberbanding is an OSX visual effect. When a user scrolls the content 386 // Rubberbanding is an OSX visual effect. When a user scrolls the content
380 // area with a track pad, and the content area is already at its limit in 387 // area with a track pad, and the content area is already at its limit in
381 // the direction being scrolled, the entire content area is allowed to 388 // the direction being scrolled, the entire content area is allowed to
382 // scroll slightly off screen, revealing a grey background. When the user 389 // scroll slightly off screen, revealing a grey background. When the user
383 // lets go, the content area snaps back into place. Blink is responsible 390 // lets go, the content area snaps back into place. Blink is responsible
384 // for this rubberbanding effect, but the embedder may wish to disable 391 // for this rubberbanding effect, but the embedder may wish to disable
385 // rubber banding in the left or right direction, if the scroll should have 392 // rubber banding in the left or right direction, if the scroll should have
(...skipping 19 matching lines...) Expand all
405 RailsMode railsMode; 412 RailsMode railsMode;
406 413
407 WebMouseWheelEvent() 414 WebMouseWheelEvent()
408 : WebMouseEvent(sizeof(WebMouseWheelEvent)) 415 : WebMouseEvent(sizeof(WebMouseWheelEvent))
409 , deltaX(0.0f) 416 , deltaX(0.0f)
410 , deltaY(0.0f) 417 , deltaY(0.0f)
411 , wheelTicksX(0.0f) 418 , wheelTicksX(0.0f)
412 , wheelTicksY(0.0f) 419 , wheelTicksY(0.0f)
413 , accelerationRatioX(1.0f) 420 , accelerationRatioX(1.0f)
414 , accelerationRatioY(1.0f) 421 , accelerationRatioY(1.0f)
422 , resendingPluginId(-1)
415 , phase(PhaseNone) 423 , phase(PhaseNone)
416 , momentumPhase(PhaseNone) 424 , momentumPhase(PhaseNone)
417 , canRubberbandLeft(true) 425 , canRubberbandLeft(true)
418 , canRubberbandRight(true) 426 , canRubberbandRight(true)
419 , scrollByPage(false) 427 , scrollByPage(false)
420 , hasPreciseScrollingDeltas(false) 428 , hasPreciseScrollingDeltas(false)
421 , canScroll(true) 429 , canScroll(true)
422 , railsMode(RailsModeFree) 430 , railsMode(RailsModeFree)
423 { 431 {
424 } 432 }
425 }; 433 };
426 434
427 // WebGestureEvent ------------------------------------------------------------- - 435 // WebGestureEvent ------------------------------------------------------------- -
428 436
429 class WebGestureEvent : public WebInputEvent { 437 class WebGestureEvent : public WebInputEvent {
430 public: 438 public:
431 int x; 439 int x;
432 int y; 440 int y;
433 int globalX; 441 int globalX;
434 int globalY; 442 int globalY;
435 WebGestureDevice sourceDevice; 443 WebGestureDevice sourceDevice;
444 // This field exists to allow BrowserPlugin to mark GestureScroll events as
445 // 'resent' to handle the case where an event is not consumed when first
446 // encountered; it should be handled differently by the plugin when it is
447 // sent for thesecond time. No code within Blink touches this, other than to
448 // plumb it through event conversions.
449 int resendingPluginId;
436 450
437 union { 451 union {
438 // Tap information must be set for GestureTap, GestureTapUnconfirmed, 452 // Tap information must be set for GestureTap, GestureTapUnconfirmed,
439 // and GestureDoubleTap events. 453 // and GestureDoubleTap events.
440 struct { 454 struct {
441 int tapCount; 455 int tapCount;
442 float width; 456 float width;
443 float height; 457 float height;
444 } tap; 458 } tap;
445 459
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 float scale; 521 float scale;
508 } pinchUpdate; 522 } pinchUpdate;
509 } data; 523 } data;
510 524
511 WebGestureEvent() 525 WebGestureEvent()
512 : WebInputEvent(sizeof(WebGestureEvent)) 526 : WebInputEvent(sizeof(WebGestureEvent))
513 , x(0) 527 , x(0)
514 , y(0) 528 , y(0)
515 , globalX(0) 529 , globalX(0)
516 , globalY(0) 530 , globalY(0)
531 , resendingPluginId(-1)
517 { 532 {
518 memset(&data, 0, sizeof(data)); 533 memset(&data, 0, sizeof(data));
519 } 534 }
520 }; 535 };
521 536
522 // WebTouchEvent -------------------------------------------------------------- 537 // WebTouchEvent --------------------------------------------------------------
523 538
524 // TODO(e_hakkinen): Replace with WebPointerEvent. crbug.com/508283 539 // TODO(e_hakkinen): Replace with WebPointerEvent. crbug.com/508283
525 class WebTouchEvent : public WebInputEvent { 540 class WebTouchEvent : public WebInputEvent {
526 public: 541 public:
(...skipping 27 matching lines...) Expand all
554 , uniqueTouchEventId(0) 569 , uniqueTouchEventId(0)
555 { 570 {
556 } 571 }
557 }; 572 };
558 573
559 #pragma pack(pop) 574 #pragma pack(pop)
560 575
561 } // namespace blink 576 } // namespace blink
562 577
563 #endif 578 #endif
OLDNEW
« no previous file with comments | « Source/web/tests/WebInputEventConversionTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698