| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 | 369 |
| 370 if (currentPosition > startPosition) | 370 if (currentPosition > startPosition) |
| 371 paintSliderRangeHighlight(rect, style, context, startPosition, curre
ntPosition, startColor, endColor); | 371 paintSliderRangeHighlight(rect, style, context, startPosition, curre
ntPosition, startColor, endColor); |
| 372 | 372 |
| 373 // Draw grey-ish highlight after current time. | 373 // Draw grey-ish highlight after current time. |
| 374 if (!useNewUi) { | 374 if (!useNewUi) { |
| 375 startColor = Color(60, 60, 60); | 375 startColor = Color(60, 60, 60); |
| 376 endColor = Color(76, 76, 76); | 376 endColor = Color(76, 76, 76); |
| 377 } else { | 377 } else { |
| 378 startColor = endColor = Color(0x9f, 0x9f, 0x9f); // light grey. | 378 startColor = endColor = Color(0x5a, 0x5a, 0x5a); // dark grey |
| 379 } | 379 } |
| 380 | 380 |
| 381 if (endPosition > currentPosition) | 381 if (endPosition > currentPosition) |
| 382 paintSliderRangeHighlight(rect, style, context, currentPosition, end
Position, startColor, endColor); | 382 paintSliderRangeHighlight(rect, style, context, currentPosition, end
Position, startColor, endColor); |
| 383 | 383 |
| 384 return; | 384 return; |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 | 387 |
| 388 void MediaControlsPainter::adjustMediaSliderThumbPaintSize(const IntRect& rect,
const ComputedStyle& style, IntRect& rectOut) | 388 void MediaControlsPainter::adjustMediaSliderThumbPaintSize(const IntRect& rect,
const ComputedStyle& style, IntRect& rectOut) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 return false; | 434 return false; |
| 435 | 435 |
| 436 GraphicsContext& context = paintInfo.context; | 436 GraphicsContext& context = paintInfo.context; |
| 437 const ComputedStyle& style = object.styleRef(); | 437 const ComputedStyle& style = object.styleRef(); |
| 438 | 438 |
| 439 // Paint the slider bar. | 439 // Paint the slider bar. |
| 440 Color sliderBackgroundColor; | 440 Color sliderBackgroundColor; |
| 441 if (!RuntimeEnabledFeatures::newMediaPlaybackUiEnabled()) | 441 if (!RuntimeEnabledFeatures::newMediaPlaybackUiEnabled()) |
| 442 sliderBackgroundColor = Color(11, 11, 11); | 442 sliderBackgroundColor = Color(11, 11, 11); |
| 443 else | 443 else |
| 444 sliderBackgroundColor = Color(0x9f, 0x9f, 0x9f); | 444 sliderBackgroundColor = Color(0x5a, 0x5a, 0x5a); // dark grey |
| 445 paintRoundedSliderBackground(rect, style, context, sliderBackgroundColor); | 445 paintRoundedSliderBackground(rect, style, context, sliderBackgroundColor); |
| 446 | 446 |
| 447 // Calculate volume position for white background rectangle. | 447 // Calculate volume position for white background rectangle. |
| 448 float volume = mediaElement->volume(); | 448 float volume = mediaElement->volume(); |
| 449 if (std::isnan(volume) || volume < 0) | 449 if (std::isnan(volume) || volume < 0) |
| 450 return true; | 450 return true; |
| 451 if (volume > 1) | 451 if (volume > 1) |
| 452 volume = 1; | 452 volume = 1; |
| 453 if (!hasSource(mediaElement) || !mediaElement->hasAudio() || mediaElement->m
uted()) | 453 if (!hasSource(mediaElement) || !mediaElement->hasAudio() || mediaElement->m
uted()) |
| 454 volume = 0; | 454 volume = 0; |
| (...skipping 177 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 |