OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 DrawingRecorder recorder(gc, scrollbar, DisplayItem::kScrollbarThumb, rect); | 333 DrawingRecorder recorder(gc, scrollbar, DisplayItem::kScrollbarThumb, rect); |
334 | 334 |
335 WebThemeEngine::State state; | 335 WebThemeEngine::State state; |
336 WebCanvas* canvas = gc.canvas(); | 336 WebCanvas* canvas = gc.canvas(); |
337 if (scrollbar.pressedPart() == ThumbPart) | 337 if (scrollbar.pressedPart() == ThumbPart) |
338 state = WebThemeEngine::StatePressed; | 338 state = WebThemeEngine::StatePressed; |
339 else if (scrollbar.hoveredPart() == ThumbPart) | 339 else if (scrollbar.hoveredPart() == ThumbPart) |
340 state = WebThemeEngine::StateHover; | 340 state = WebThemeEngine::StateHover; |
341 else | 341 else |
342 state = WebThemeEngine::StateNormal; | 342 state = WebThemeEngine::StateNormal; |
343 | |
344 blink::WebThemeEngine::ExtraParams params; | |
343 Platform::current()->themeEngine()->paint( | 345 Platform::current()->themeEngine()->paint( |
344 canvas, scrollbar.orientation() == HorizontalScrollbar | 346 canvas, scrollbar.orientation() == HorizontalScrollbar |
345 ? WebThemeEngine::PartScrollbarHorizontalThumb | 347 ? WebThemeEngine::PartScrollbarHorizontalThumb |
346 : WebThemeEngine::PartScrollbarVerticalThumb, | 348 : WebThemeEngine::PartScrollbarVerticalThumb, |
347 state, WebRect(rect), 0); | 349 state, WebRect(rect), ¶ms); |
bokan
2016/10/21 20:11:38
Ah, this is why you had the |else| case in GetNati
| |
348 } | 350 } |
349 | 351 |
350 bool ScrollbarThemeAura::shouldRepaintAllPartsOnInvalidation() const { | 352 bool ScrollbarThemeAura::shouldRepaintAllPartsOnInvalidation() const { |
351 // This theme can separately handle thumb invalidation. | 353 // This theme can separately handle thumb invalidation. |
352 return false; | 354 return false; |
353 } | 355 } |
354 | 356 |
355 ScrollbarPart ScrollbarThemeAura::invalidateOnThumbPositionChange( | 357 ScrollbarPart ScrollbarThemeAura::invalidateOnThumbPositionChange( |
356 const ScrollbarThemeClient& scrollbar, | 358 const ScrollbarThemeClient& scrollbar, |
357 float oldPosition, | 359 float oldPosition, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
391 } | 393 } |
392 | 394 |
393 // HorizontalScrollbar | 395 // HorizontalScrollbar |
394 int squareSize = scrollbar.height(); | 396 int squareSize = scrollbar.height(); |
395 return IntSize( | 397 return IntSize( |
396 scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize, | 398 scrollbar.width() < 2 * squareSize ? scrollbar.width() / 2 : squareSize, |
397 squareSize); | 399 squareSize); |
398 } | 400 } |
399 | 401 |
400 } // namespace blink | 402 } // namespace blink |
OLD | NEW |