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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 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
OLDNEW
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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 // state on the hovered part. 316 // state on the hovered part.
317 || m_hoveredPart != NoPart) 317 || m_hoveredPart != NoPart)
318 setNeedsPaintInvalidation( 318 setNeedsPaintInvalidation(
319 static_cast<ScrollbarPart>(m_pressedPart | m_hoveredPart | part)); 319 static_cast<ScrollbarPart>(m_pressedPart | m_hoveredPart | part));
320 m_pressedPart = part; 320 m_pressedPart = part;
321 } 321 }
322 322
323 bool Scrollbar::gestureEvent(const WebGestureEvent& evt, 323 bool Scrollbar::gestureEvent(const WebGestureEvent& evt,
324 bool* shouldUpdateCapture) { 324 bool* shouldUpdateCapture) {
325 DCHECK(shouldUpdateCapture); 325 DCHECK(shouldUpdateCapture);
326 switch (evt.type) { 326 switch (evt.type()) {
327 case WebInputEvent::GestureTapDown: { 327 case WebInputEvent::GestureTapDown: {
328 IntPoint position = flooredIntPoint(evt.positionInRootFrame()); 328 IntPoint position = flooredIntPoint(evt.positionInRootFrame());
329 setPressedPart(theme().hitTest(*this, position)); 329 setPressedPart(theme().hitTest(*this, position));
330 m_pressedPos = orientation() == HorizontalScrollbar 330 m_pressedPos = orientation() == HorizontalScrollbar
331 ? convertFromRootFrame(position).x() 331 ? convertFromRootFrame(position).x()
332 : convertFromRootFrame(position).y(); 332 : convertFromRootFrame(position).y();
333 *shouldUpdateCapture = true; 333 *shouldUpdateCapture = true;
334 return true; 334 return true;
335 } 335 }
336 case WebInputEvent::GestureTapCancel: 336 case WebInputEvent::GestureTapCancel:
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 invalidParts = AllParts; 629 invalidParts = AllParts;
630 if (invalidParts & ~ThumbPart) 630 if (invalidParts & ~ThumbPart)
631 m_trackNeedsRepaint = true; 631 m_trackNeedsRepaint = true;
632 if (invalidParts & ThumbPart) 632 if (invalidParts & ThumbPart)
633 m_thumbNeedsRepaint = true; 633 m_thumbNeedsRepaint = true;
634 if (m_scrollableArea) 634 if (m_scrollableArea)
635 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); 635 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation());
636 } 636 }
637 637
638 } // namespace blink 638 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698