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

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

Issue 2631113003: Add metric to know how user use scrollbar (Closed)
Patch Set: rebase 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 m_hoveredPart = part; 310 m_hoveredPart = part;
311 } 311 }
312 312
313 void Scrollbar::setPressedPart(ScrollbarPart part) { 313 void Scrollbar::setPressedPart(ScrollbarPart part) {
314 if (m_pressedPart != NoPart 314 if (m_pressedPart != NoPart
315 // When we no longer have a pressed part, we can start drawing a hovered 315 // When we no longer have a pressed part, we can start drawing a hovered
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
321 if (getScrollableArea())
322 getScrollableArea()->didScrollWithScrollbar(part, orientation());
323
320 m_pressedPart = part; 324 m_pressedPart = part;
321 } 325 }
322 326
323 bool Scrollbar::gestureEvent(const WebGestureEvent& evt, 327 bool Scrollbar::gestureEvent(const WebGestureEvent& evt,
324 bool* shouldUpdateCapture) { 328 bool* shouldUpdateCapture) {
325 DCHECK(shouldUpdateCapture); 329 DCHECK(shouldUpdateCapture);
326 switch (evt.type()) { 330 switch (evt.type()) {
327 case WebInputEvent::GestureTapDown: { 331 case WebInputEvent::GestureTapDown: {
328 IntPoint position = flooredIntPoint(evt.positionInRootFrame()); 332 IntPoint position = flooredIntPoint(evt.positionInRootFrame());
329 setPressedPart(theme().hitTest(*this, position)); 333 setPressedPart(theme().hitTest(*this, position));
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 invalidParts = AllParts; 633 invalidParts = AllParts;
630 if (invalidParts & ~ThumbPart) 634 if (invalidParts & ~ThumbPart)
631 m_trackNeedsRepaint = true; 635 m_trackNeedsRepaint = true;
632 if (invalidParts & ThumbPart) 636 if (invalidParts & ThumbPart)
633 m_thumbNeedsRepaint = true; 637 m_thumbNeedsRepaint = true;
634 if (m_scrollableArea) 638 if (m_scrollableArea)
635 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); 639 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation());
636 } 640 }
637 641
638 } // namespace blink 642 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698