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

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

Issue 759073002: Add canScroll bit to WebMouseWheelEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Made changes based on comments Created 6 years 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
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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 // See comment at the top of the file for why an int is used here. 356 // See comment at the top of the file for why an int is used here.
357 int scrollByPage; 357 int scrollByPage;
358 358
359 // See comment at the top of the file for why an int is used here. 359 // See comment at the top of the file for why an int is used here.
360 int hasPreciseScrollingDeltas; 360 int hasPreciseScrollingDeltas;
361 Phase phase; 361 Phase phase;
362 Phase momentumPhase; 362 Phase momentumPhase;
363 363
364 // See comment at the top of the file for why an int is used here. 364 // See comment at the top of the file for why an int is used here.
365 // When false, this wheel event should not trigger scrolling (or any other d efault
366 // action) if the event goes unhandled by JavaScript. This is used, for exam ple,
367 // when the browser decides the default behavior for Ctrl+Wheel should be to zoom
368 // instead of scroll.
369 int canScroll;
370
371 // See comment at the top of the file for why an int is used here.
365 // Rubberbanding is an OSX visual effect. When a user scrolls the content 372 // Rubberbanding is an OSX visual effect. When a user scrolls the content
366 // area with a track pad, and the content area is already at its limit in 373 // area with a track pad, and the content area is already at its limit in
367 // the direction being scrolled, the entire content area is allowed to 374 // the direction being scrolled, the entire content area is allowed to
368 // scroll slightly off screen, revealing a grey background. When the user 375 // scroll slightly off screen, revealing a grey background. When the user
369 // lets go, the content area snaps back into place. Blink is responsible 376 // lets go, the content area snaps back into place. Blink is responsible
370 // for this rubberbanding effect, but the embedder may wish to disable 377 // for this rubberbanding effect, but the embedder may wish to disable
371 // rubber banding in the left or right direction, if the scroll should have 378 // rubber banding in the left or right direction, if the scroll should have
372 // an alternate effect. The common case is that a scroll in the left or 379 // an alternate effect. The common case is that a scroll in the left or
373 // right directions causes a back or forwards navigation, respectively. 380 // right directions causes a back or forwards navigation, respectively.
374 // 381 //
375 // These flags prevent rubber banding from starting in a given direction, 382 // These flags prevent rubber banding from starting in a given direction,
376 // but have no effect on an ongoing rubber banding. A rubber banding that 383 // but have no effect on an ongoing rubber banding. A rubber banding that
377 // started in the vertical direction is allowed to continue in the right 384 // started in the vertical direction is allowed to continue in the right
378 // direction, even if canRubberbandRight is 0. 385 // direction, even if canRubberbandRight is 0.
379 int canRubberbandLeft; 386 int canRubberbandLeft;
380 int canRubberbandRight; 387 int canRubberbandRight;
381 388
382 WebMouseWheelEvent() 389 WebMouseWheelEvent()
383 : WebMouseEvent(sizeof(WebMouseWheelEvent)) 390 : WebMouseEvent(sizeof(WebMouseWheelEvent))
384 , deltaX(0.0f) 391 , deltaX(0.0f)
385 , deltaY(0.0f) 392 , deltaY(0.0f)
386 , wheelTicksX(0.0f) 393 , wheelTicksX(0.0f)
387 , wheelTicksY(0.0f) 394 , wheelTicksY(0.0f)
388 , accelerationRatioX(1.0f) 395 , accelerationRatioX(1.0f)
389 , accelerationRatioY(1.0f) 396 , accelerationRatioY(1.0f)
390 , scrollByPage(false) 397 , scrollByPage(false)
391 , hasPreciseScrollingDeltas(false) 398 , hasPreciseScrollingDeltas(false)
392 , phase(PhaseNone) 399 , phase(PhaseNone)
393 , momentumPhase(PhaseNone) 400 , momentumPhase(PhaseNone)
401 , canScroll(true)
394 , canRubberbandLeft(true) 402 , canRubberbandLeft(true)
395 , canRubberbandRight(true) 403 , canRubberbandRight(true)
396 { 404 {
397 } 405 }
398 }; 406 };
399 407
400 // WebGestureEvent ------------------------------------------------------------- - 408 // WebGestureEvent ------------------------------------------------------------- -
401 409
402 class WebGestureEvent : public WebInputEvent { 410 class WebGestureEvent : public WebInputEvent {
403 public: 411 public:
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 , causesScrollingIfUncanceled(false) 519 , causesScrollingIfUncanceled(false)
512 { 520 {
513 } 521 }
514 }; 522 };
515 523
516 #pragma pack(pop) 524 #pragma pack(pop)
517 525
518 } // namespace blink 526 } // namespace blink
519 527
520 #endif 528 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698