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

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

Issue 2239313002: Hide non-composited native scrollbars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment Created 4 years, 4 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) 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 afterThumbRect = IntRect(trackRect.x() + beforeThumbRect.width(), trackR ect.y(), trackRect.maxX() - beforeThumbRect.maxX(), trackRect.height()); 288 afterThumbRect = IntRect(trackRect.x() + beforeThumbRect.width(), trackR ect.y(), trackRect.maxX() - beforeThumbRect.maxX(), trackRect.height());
289 } else { 289 } else {
290 thumbRect = IntRect(trackRect.x(), trackRect.y() + thumbPos, scrollbar.w idth(), thumbLength(scrollbar)); 290 thumbRect = IntRect(trackRect.x(), trackRect.y() + thumbPos, scrollbar.w idth(), thumbLength(scrollbar));
291 beforeThumbRect = IntRect(trackRect.x(), trackRect.y(), trackRect.width( ), thumbPos + thumbRect.height() / 2); 291 beforeThumbRect = IntRect(trackRect.x(), trackRect.y(), trackRect.width( ), thumbPos + thumbRect.height() / 2);
292 afterThumbRect = IntRect(trackRect.x(), trackRect.y() + beforeThumbRect. height(), trackRect.width(), trackRect.maxY() - beforeThumbRect.maxY()); 292 afterThumbRect = IntRect(trackRect.x(), trackRect.y() + beforeThumbRect. height(), trackRect.width(), trackRect.maxY() - beforeThumbRect.maxY());
293 } 293 }
294 } 294 }
295 295
296 ScrollbarTheme& ScrollbarTheme::theme() 296 ScrollbarTheme& ScrollbarTheme::theme()
297 { 297 {
298 if (RuntimeEnabledFeatures::hideScrollbarsEnabled()) {
299 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlayMock, hiddenMockTheme, (Scrollb arThemeOverlayMock::HideScrollbars));
300 return hiddenMockTheme;
301 }
298 if (ScrollbarTheme::mockScrollbarsEnabled()) { 302 if (ScrollbarTheme::mockScrollbarsEnabled()) {
299 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) { 303 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) {
300 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlayMock, overlayMockTheme, ()) ; 304 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlayMock, overlayMockTheme, ()) ;
301 return overlayMockTheme; 305 return overlayMockTheme;
302 } 306 }
303 307
304 DEFINE_STATIC_LOCAL(ScrollbarThemeMock, mockTheme, ()); 308 DEFINE_STATIC_LOCAL(ScrollbarThemeMock, mockTheme, ());
305 return mockTheme; 309 return mockTheme;
306 } 310 }
307 return nativeTheme(); 311 return nativeTheme();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 return DisplayItem::ScrollbarBackTrack; 345 return DisplayItem::ScrollbarBackTrack;
342 case ForwardTrackPart: 346 case ForwardTrackPart:
343 return DisplayItem::ScrollbarForwardTrack; 347 return DisplayItem::ScrollbarForwardTrack;
344 default: 348 default:
345 ASSERT_NOT_REACHED(); 349 ASSERT_NOT_REACHED();
346 return DisplayItem::ScrollbarBackTrack; 350 return DisplayItem::ScrollbarBackTrack;
347 } 351 }
348 } 352 }
349 353
350 } // namespace blink 354 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698