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

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

Issue 2478463003: Revert of Implement overlay scrollbar fade out for non-composited scrollers. (Closed)
Patch Set: Created 4 years, 1 month 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) 2011 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2011 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 bool ScrollbarTheme::shouldSnapBackToDragOrigin( 226 bool ScrollbarTheme::shouldSnapBackToDragOrigin(
227 const ScrollbarThemeClient& scrollbar, 227 const ScrollbarThemeClient& scrollbar,
228 const PlatformMouseEvent& evt) { 228 const PlatformMouseEvent& evt) {
229 IntPoint mousePosition = scrollbar.convertFromRootFrame(evt.position()); 229 IntPoint mousePosition = scrollbar.convertFromRootFrame(evt.position());
230 mousePosition.move(scrollbar.x(), scrollbar.y()); 230 mousePosition.move(scrollbar.x(), scrollbar.y());
231 return Platform::current()->scrollbarBehavior()->shouldSnapBackToDragOrigin( 231 return Platform::current()->scrollbarBehavior()->shouldSnapBackToDragOrigin(
232 mousePosition, trackRect(scrollbar), 232 mousePosition, trackRect(scrollbar),
233 scrollbar.orientation() == HorizontalScrollbar); 233 scrollbar.orientation() == HorizontalScrollbar);
234 } 234 }
235 235
236 double ScrollbarTheme::overlayScrollbarFadeOutDelaySeconds() const {
237 // On Mac, fading is controlled by the painting code in ScrollAnimatorMac.
238 return 0.0;
239 }
240
241 double ScrollbarTheme::overlayScrollbarFadeOutDurationSeconds() const {
242 // On Mac, fading is controlled by the painting code in ScrollAnimatorMac.
243 return 0.0;
244 }
245
246 int ScrollbarTheme::thumbPosition(const ScrollbarThemeClient& scrollbar, 236 int ScrollbarTheme::thumbPosition(const ScrollbarThemeClient& scrollbar,
247 float scrollPosition) { 237 float scrollPosition) {
248 if (scrollbar.enabled()) { 238 if (scrollbar.enabled()) {
249 float size = scrollbar.totalSize() - scrollbar.visibleSize(); 239 float size = scrollbar.totalSize() - scrollbar.visibleSize();
250 // Avoid doing a floating point divide by zero and return 1 when 240 // Avoid doing a floating point divide by zero and return 1 when
251 // usedTotalSize == visibleSize. 241 // usedTotalSize == visibleSize.
252 if (!size) 242 if (!size)
253 return 0; 243 return 0;
254 float pos = std::max(0.0f, scrollPosition) * 244 float pos = std::max(0.0f, scrollPosition) *
255 (trackLength(scrollbar) - thumbLength(scrollbar)) / size; 245 (trackLength(scrollbar) - thumbLength(scrollbar)) / size;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 return DisplayItem::kScrollbarBackTrack; 381 return DisplayItem::kScrollbarBackTrack;
392 case ForwardTrackPart: 382 case ForwardTrackPart:
393 return DisplayItem::kScrollbarForwardTrack; 383 return DisplayItem::kScrollbarForwardTrack;
394 default: 384 default:
395 ASSERT_NOT_REACHED(); 385 ASSERT_NOT_REACHED();
396 return DisplayItem::kScrollbarBackTrack; 386 return DisplayItem::kScrollbarBackTrack;
397 } 387 }
398 } 388 }
399 389
400 } // namespace blink 390 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698