| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 *should_update_capture = true; | 355 *should_update_capture = true; |
| 356 SetPressedPart(kNoPart); | 356 SetPressedPart(kNoPart); |
| 357 pressed_pos_ = 0; | 357 pressed_pos_ = 0; |
| 358 return true; | 358 return true; |
| 359 case kWebGestureDeviceTouchscreen: | 359 case kWebGestureDeviceTouchscreen: |
| 360 if (pressed_part_ != kThumbPart) | 360 if (pressed_part_ != kThumbPart) |
| 361 return false; | 361 return false; |
| 362 scroll_pos_ = pressed_pos_; | 362 scroll_pos_ = pressed_pos_; |
| 363 return true; | 363 return true; |
| 364 default: | 364 default: |
| 365 ASSERT_NOT_REACHED(); | 365 NOTREACHED(); |
| 366 return true; | 366 return true; |
| 367 } | 367 } |
| 368 break; | 368 break; |
| 369 case WebInputEvent::kGestureScrollUpdate: | 369 case WebInputEvent::kGestureScrollUpdate: |
| 370 switch (evt.source_device) { | 370 switch (evt.source_device) { |
| 371 case kWebGestureDeviceTouchpad: { | 371 case kWebGestureDeviceTouchpad: { |
| 372 FloatSize delta(-evt.DeltaXInRootFrame(), -evt.DeltaYInRootFrame()); | 372 FloatSize delta(-evt.DeltaXInRootFrame(), -evt.DeltaYInRootFrame()); |
| 373 if (scrollable_area_ && | 373 if (scrollable_area_ && |
| 374 scrollable_area_ | 374 scrollable_area_ |
| 375 ->UserScroll(ToPlatformScrollGranularity(evt.DeltaUnits()), | 375 ->UserScroll(ToPlatformScrollGranularity(evt.DeltaUnits()), |
| 376 delta) | 376 delta) |
| 377 .DidScroll()) { | 377 .DidScroll()) { |
| 378 return true; | 378 return true; |
| 379 } | 379 } |
| 380 return false; | 380 return false; |
| 381 } | 381 } |
| 382 case kWebGestureDeviceTouchscreen: | 382 case kWebGestureDeviceTouchscreen: |
| 383 if (pressed_part_ != kThumbPart) | 383 if (pressed_part_ != kThumbPart) |
| 384 return false; | 384 return false; |
| 385 scroll_pos_ += Orientation() == kHorizontalScrollbar | 385 scroll_pos_ += Orientation() == kHorizontalScrollbar |
| 386 ? evt.DeltaXInRootFrame() | 386 ? evt.DeltaXInRootFrame() |
| 387 : evt.DeltaYInRootFrame(); | 387 : evt.DeltaYInRootFrame(); |
| 388 MoveThumb(scroll_pos_, false); | 388 MoveThumb(scroll_pos_, false); |
| 389 return true; | 389 return true; |
| 390 default: | 390 default: |
| 391 ASSERT_NOT_REACHED(); | 391 NOTREACHED(); |
| 392 return true; | 392 return true; |
| 393 } | 393 } |
| 394 break; | 394 break; |
| 395 case WebInputEvent::kGestureScrollEnd: | 395 case WebInputEvent::kGestureScrollEnd: |
| 396 case WebInputEvent::kGestureLongPress: | 396 case WebInputEvent::kGestureLongPress: |
| 397 case WebInputEvent::kGestureFlingStart: | 397 case WebInputEvent::kGestureFlingStart: |
| 398 scroll_pos_ = 0; | 398 scroll_pos_ = 0; |
| 399 pressed_pos_ = 0; | 399 pressed_pos_ = 0; |
| 400 SetPressedPart(kNoPart); | 400 SetPressedPart(kNoPart); |
| 401 return false; | 401 return false; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 invalid_parts = kAllParts; | 637 invalid_parts = kAllParts; |
| 638 if (invalid_parts & ~kThumbPart) | 638 if (invalid_parts & ~kThumbPart) |
| 639 track_needs_repaint_ = true; | 639 track_needs_repaint_ = true; |
| 640 if (invalid_parts & kThumbPart) | 640 if (invalid_parts & kThumbPart) |
| 641 thumb_needs_repaint_ = true; | 641 thumb_needs_repaint_ = true; |
| 642 if (scrollable_area_) | 642 if (scrollable_area_) |
| 643 scrollable_area_->SetScrollbarNeedsPaintInvalidation(Orientation()); | 643 scrollable_area_->SetScrollbarNeedsPaintInvalidation(Orientation()); |
| 644 } | 644 } |
| 645 | 645 |
| 646 } // namespace blink | 646 } // namespace blink |
| OLD | NEW |