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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 static Image* PlatformResource(const char* name) { | 62 static Image* PlatformResource(const char* name) { |
63 if (!g_media_control_image_map) | 63 if (!g_media_control_image_map) |
64 g_media_control_image_map = new MediaControlImageMap(); | 64 g_media_control_image_map = new MediaControlImageMap(); |
65 if (Image* image = g_media_control_image_map->at(name)) | 65 if (Image* image = g_media_control_image_map->at(name)) |
66 return image; | 66 return image; |
67 if (Image* image = Image::LoadPlatformResource(name).LeakRef()) { | 67 if (Image* image = Image::LoadPlatformResource(name).LeakRef()) { |
68 g_media_control_image_map->Set(name, image); | 68 g_media_control_image_map->Set(name, image); |
69 return image; | 69 return image; |
70 } | 70 } |
71 ASSERT_NOT_REACHED(); | 71 NOTREACHED(); |
72 return 0; | 72 return 0; |
73 } | 73 } |
74 | 74 |
75 static bool HasSource(const HTMLMediaElement* media_element) { | 75 static bool HasSource(const HTMLMediaElement* media_element) { |
76 return media_element->getNetworkState() != HTMLMediaElement::kNetworkEmpty && | 76 return media_element->getNetworkState() != HTMLMediaElement::kNetworkEmpty && |
77 media_element->getNetworkState() != HTMLMediaElement::kNetworkNoSource; | 77 media_element->getNetworkState() != HTMLMediaElement::kNetworkNoSource; |
78 } | 78 } |
79 | 79 |
80 static FloatRect AdjustRectForPadding(IntRect rect, | 80 static FloatRect AdjustRectForPadding(IntRect rect, |
81 const LayoutObject* object) { | 81 const LayoutObject* object) { |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 return PaintMediaButton(paint_info.context, rect, media_cast_on, &object, | 541 return PaintMediaButton(paint_info.context, rect, media_cast_on, &object, |
542 is_enabled); | 542 is_enabled); |
543 case kMediaOverlayCastOnButton: | 543 case kMediaOverlayCastOnButton: |
544 return PaintMediaButton(paint_info.context, rect, media_cast_on); | 544 return PaintMediaButton(paint_info.context, rect, media_cast_on); |
545 case kMediaCastOffButton: | 545 case kMediaCastOffButton: |
546 return PaintMediaButton(paint_info.context, rect, media_cast_off, &object, | 546 return PaintMediaButton(paint_info.context, rect, media_cast_off, &object, |
547 is_enabled); | 547 is_enabled); |
548 case kMediaOverlayCastOffButton: | 548 case kMediaOverlayCastOffButton: |
549 return PaintMediaButton(paint_info.context, rect, media_overlay_cast_off); | 549 return PaintMediaButton(paint_info.context, rect, media_overlay_cast_off); |
550 default: | 550 default: |
551 ASSERT_NOT_REACHED(); | 551 NOTREACHED(); |
552 return false; | 552 return false; |
553 } | 553 } |
554 } | 554 } |
555 | 555 |
556 bool MediaControlsPainter::PaintMediaTrackSelectionCheckmark( | 556 bool MediaControlsPainter::PaintMediaTrackSelectionCheckmark( |
557 const LayoutObject& object, | 557 const LayoutObject& object, |
558 const PaintInfo& paint_info, | 558 const PaintInfo& paint_info, |
559 const IntRect& rect) { | 559 const IntRect& rect) { |
560 const HTMLMediaElement* media_element = ToParentMediaElement(object); | 560 const HTMLMediaElement* media_element = ToParentMediaElement(object); |
561 if (!media_element) | 561 if (!media_element) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 void MediaControlsPainter::AdjustMediaSliderThumbSize(ComputedStyle& style) { | 623 void MediaControlsPainter::AdjustMediaSliderThumbSize(ComputedStyle& style) { |
624 const float zoom_level = style.EffectiveZoom(); | 624 const float zoom_level = style.EffectiveZoom(); |
625 | 625 |
626 style.SetWidth(Length( | 626 style.SetWidth(Length( |
627 static_cast<int>(kMediaSliderThumbTouchWidth * zoom_level), kFixed)); | 627 static_cast<int>(kMediaSliderThumbTouchWidth * zoom_level), kFixed)); |
628 style.SetHeight(Length( | 628 style.SetHeight(Length( |
629 static_cast<int>(kMediaSliderThumbTouchHeight * zoom_level), kFixed)); | 629 static_cast<int>(kMediaSliderThumbTouchHeight * zoom_level), kFixed)); |
630 } | 630 } |
631 | 631 |
632 } // namespace blink | 632 } // namespace blink |
OLD | NEW |