OLD | NEW |
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 Loading... |
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 } | |
302 if (ScrollbarTheme::mockScrollbarsEnabled()) { | 298 if (ScrollbarTheme::mockScrollbarsEnabled()) { |
303 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) { | 299 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) { |
304 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlayMock, overlayMockTheme, ())
; | 300 DEFINE_STATIC_LOCAL(ScrollbarThemeOverlayMock, overlayMockTheme, ())
; |
305 return overlayMockTheme; | 301 return overlayMockTheme; |
306 } | 302 } |
307 | 303 |
308 DEFINE_STATIC_LOCAL(ScrollbarThemeMock, mockTheme, ()); | 304 DEFINE_STATIC_LOCAL(ScrollbarThemeMock, mockTheme, ()); |
309 return mockTheme; | 305 return mockTheme; |
310 } | 306 } |
311 return nativeTheme(); | 307 return nativeTheme(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 return DisplayItem::kScrollbarBackTrack; | 341 return DisplayItem::kScrollbarBackTrack; |
346 case ForwardTrackPart: | 342 case ForwardTrackPart: |
347 return DisplayItem::kScrollbarForwardTrack; | 343 return DisplayItem::kScrollbarForwardTrack; |
348 default: | 344 default: |
349 ASSERT_NOT_REACHED(); | 345 ASSERT_NOT_REACHED(); |
350 return DisplayItem::kScrollbarBackTrack; | 346 return DisplayItem::kScrollbarBackTrack; |
351 } | 347 } |
352 } | 348 } |
353 | 349 |
354 } // namespace blink | 350 } // namespace blink |
OLD | NEW |