OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. | 2 * Copyright (C) 2009 Apple Inc. |
3 * Copyright (C) 2009 Google Inc. | 3 * Copyright (C) 2009 Google Inc. |
4 * All rights reserved. | 4 * All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 rectOut.setY(rect.center().y() - zoomedPaintHeight / 2); | 406 rectOut.setY(rect.center().y() - zoomedPaintHeight / 2); |
407 rectOut.setWidth(zoomedPaintWidth); | 407 rectOut.setWidth(zoomedPaintWidth); |
408 rectOut.setHeight(zoomedPaintHeight); | 408 rectOut.setHeight(zoomedPaintHeight); |
409 } | 409 } |
410 | 410 |
411 bool MediaControlsPainter::paintMediaSliderThumb(const LayoutObject& object, con
st PaintInfo& paintInfo, const IntRect& rect) | 411 bool MediaControlsPainter::paintMediaSliderThumb(const LayoutObject& object, con
st PaintInfo& paintInfo, const IntRect& rect) |
412 { | 412 { |
413 if (!object.node()) | 413 if (!object.node()) |
414 return false; | 414 return false; |
415 | 415 |
416 const HTMLMediaElement* mediaElement = toParentMediaElement(object.node()->s
hadowHost()); | 416 const HTMLMediaElement* mediaElement = toParentMediaElement(object.node()->o
wnerShadowHost()); |
417 if (!mediaElement) | 417 if (!mediaElement) |
418 return false; | 418 return false; |
419 | 419 |
420 if (!hasSource(mediaElement)) | 420 if (!hasSource(mediaElement)) |
421 return true; | 421 return true; |
422 | 422 |
423 Image* mediaSliderThumb = getMediaSliderThumb(); | 423 Image* mediaSliderThumb = getMediaSliderThumb(); |
424 IntRect paintRect; | 424 IntRect paintRect; |
425 const ComputedStyle& style = object.styleRef(); | 425 const ComputedStyle& style = object.styleRef(); |
426 adjustMediaSliderThumbPaintSize(rect, style, paintRect); | 426 adjustMediaSliderThumbPaintSize(rect, style, paintRect); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 paintSliderRangeHighlight(rect, style, context, 0.0, fillWidth, startColor,
endColor); | 474 paintSliderRangeHighlight(rect, style, context, 0.0, fillWidth, startColor,
endColor); |
475 | 475 |
476 return true; | 476 return true; |
477 } | 477 } |
478 | 478 |
479 bool MediaControlsPainter::paintMediaVolumeSliderThumb(const LayoutObject& objec
t, const PaintInfo& paintInfo, const IntRect& rect) | 479 bool MediaControlsPainter::paintMediaVolumeSliderThumb(const LayoutObject& objec
t, const PaintInfo& paintInfo, const IntRect& rect) |
480 { | 480 { |
481 if (!object.node()) | 481 if (!object.node()) |
482 return false; | 482 return false; |
483 | 483 |
484 const HTMLMediaElement* mediaElement = toParentMediaElement(object.node()->s
hadowHost()); | 484 const HTMLMediaElement* mediaElement = toParentMediaElement(object.node()->o
wnerShadowHost()); |
485 if (!mediaElement) | 485 if (!mediaElement) |
486 return false; | 486 return false; |
487 | 487 |
488 if (!hasSource(mediaElement) || !mediaElement->hasAudio()) | 488 if (!hasSource(mediaElement) || !mediaElement->hasAudio()) |
489 return true; | 489 return true; |
490 | 490 |
491 static Image* mediaVolumeSliderThumb = platformResource( | 491 static Image* mediaVolumeSliderThumb = platformResource( |
492 "mediaplayerVolumeSliderThumb", | 492 "mediaplayerVolumeSliderThumb", |
493 "mediaplayerVolumeSliderThumbNew"); | 493 "mediaplayerVolumeSliderThumbNew"); |
494 | 494 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 } | 632 } |
633 | 633 |
634 float zoomLevel = style.effectiveZoom(); | 634 float zoomLevel = style.effectiveZoom(); |
635 if (thumbImage) { | 635 if (thumbImage) { |
636 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed)); | 636 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed)); |
637 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed)); | 637 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed)); |
638 } | 638 } |
639 } | 639 } |
640 | 640 |
641 } // namespace blink | 641 } // namespace blink |
OLD | NEW |