| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 Color sliderBackgroundColor; | 291 Color sliderBackgroundColor; |
| 292 if (!useNewUi) | 292 if (!useNewUi) |
| 293 sliderBackgroundColor = Color(11, 11, 11); | 293 sliderBackgroundColor = Color(11, 11, 11); |
| 294 else | 294 else |
| 295 sliderBackgroundColor = Color(0xda, 0xda, 0xda); | 295 sliderBackgroundColor = Color(0xda, 0xda, 0xda); |
| 296 | 296 |
| 297 paintRoundedSliderBackground(rect, style, context, sliderBackgroundColor); | 297 paintRoundedSliderBackground(rect, style, context, sliderBackgroundColor); |
| 298 | 298 |
| 299 // Draw the buffered range. Since the element may have multiple buffered ran
ges and it'd be | 299 // Draw the buffered range. Since the element may have multiple buffered ran
ges and it'd be |
| 300 // distracting/'busy' to show all of them, show only the buffered range cont
aining the current play head. | 300 // distracting/'busy' to show all of them, show only the buffered range cont
aining the current play head. |
| 301 RefPtrWillBeRawPtr<TimeRanges> bufferedTimeRanges = mediaElement->buffered()
; | 301 TimeRanges* bufferedTimeRanges = mediaElement->buffered(); |
| 302 float duration = mediaElement->duration(); | 302 float duration = mediaElement->duration(); |
| 303 float currentTime = mediaElement->currentTime(); | 303 float currentTime = mediaElement->currentTime(); |
| 304 if (std::isnan(duration) || std::isinf(duration) || !duration || std::isnan(
currentTime)) | 304 if (std::isnan(duration) || std::isinf(duration) || !duration || std::isnan(
currentTime)) |
| 305 return; | 305 return; |
| 306 | 306 |
| 307 for (unsigned i = 0; i < bufferedTimeRanges->length(); ++i) { | 307 for (unsigned i = 0; i < bufferedTimeRanges->length(); ++i) { |
| 308 float start = bufferedTimeRanges->start(i, ASSERT_NO_EXCEPTION); | 308 float start = bufferedTimeRanges->start(i, ASSERT_NO_EXCEPTION); |
| 309 float end = bufferedTimeRanges->end(i, ASSERT_NO_EXCEPTION); | 309 float end = bufferedTimeRanges->end(i, ASSERT_NO_EXCEPTION); |
| 310 // The delta is there to avoid corner cases when buffered | 310 // The delta is there to avoid corner cases when buffered |
| 311 // ranges is out of sync with current time because of | 311 // ranges is out of sync with current time because of |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 } | 570 } |
| 571 | 571 |
| 572 float zoomLevel = style.effectiveZoom(); | 572 float zoomLevel = style.effectiveZoom(); |
| 573 if (thumbImage) { | 573 if (thumbImage) { |
| 574 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed)); | 574 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed)); |
| 575 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed)); | 575 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed)); |
| 576 } | 576 } |
| 577 } | 577 } |
| 578 | 578 |
| 579 } // namespace blink | 579 } // namespace blink |
| OLD | NEW |