Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp

Issue 2376353002: Apply media controls button Android rules for all of them. (Closed)
Patch Set: rebaseline Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/mediaControlsAndroidNew.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 return paintMediaButton(paintInfo.context, rect, mediaSubtitlesIcon); 605 return paintMediaButton(paintInfo.context, rect, mediaSubtitlesIcon);
606 } 606 }
607 607
608 bool MediaControlsPainter::paintMediaOverflowMenu(const LayoutObject& object, co nst PaintInfo& paintInfo, const IntRect& rect) 608 bool MediaControlsPainter::paintMediaOverflowMenu(const LayoutObject& object, co nst PaintInfo& paintInfo, const IntRect& rect)
609 { 609 {
610 const HTMLMediaElement* mediaElement = toParentMediaElement(object); 610 const HTMLMediaElement* mediaElement = toParentMediaElement(object);
611 if (!mediaElement) 611 if (!mediaElement)
612 return false; 612 return false;
613 613
614 static Image* mediaOverflowButton = platformResource("mediaplayerOverflowMen u"); 614 static Image* mediaOverflowButton = platformResource("mediaplayerOverflowMen u");
615 return paintMediaButton(paintInfo.context, rect, mediaOverflowButton); 615 return paintMediaButton(paintInfo.context, rect, mediaOverflowButton, &objec t, true);
616 } 616 }
617 617
618 bool MediaControlsPainter::paintMediaDownloadIcon(const LayoutObject& object, co nst PaintInfo& paintInfo, const IntRect& rect) 618 bool MediaControlsPainter::paintMediaDownloadIcon(const LayoutObject& object, co nst PaintInfo& paintInfo, const IntRect& rect)
619 { 619 {
620 const HTMLMediaElement* mediaElement = toParentMediaElement(object); 620 const HTMLMediaElement* mediaElement = toParentMediaElement(object);
621 if (!mediaElement) 621 if (!mediaElement)
622 return false; 622 return false;
623 623
624 bool isEnabled = hasSource(mediaElement);
625
624 static Image* mediaDownloadIcon = platformResource("mediaplayerDownloadIcon" ); 626 static Image* mediaDownloadIcon = platformResource("mediaplayerDownloadIcon" );
625 return paintMediaButton(paintInfo.context, rect, mediaDownloadIcon); 627 return paintMediaButton(paintInfo.context, rect, mediaDownloadIcon, &object, isEnabled);
626 } 628 }
627 629
628 void MediaControlsPainter::adjustMediaSliderThumbSize(ComputedStyle& style) 630 void MediaControlsPainter::adjustMediaSliderThumbSize(ComputedStyle& style)
629 { 631 {
630 static Image* mediaSliderThumb = platformResource("mediaplayerSliderThumb", 632 static Image* mediaSliderThumb = platformResource("mediaplayerSliderThumb",
631 "mediaplayerSliderThumbNew"); 633 "mediaplayerSliderThumbNew");
632 static Image* mediaVolumeSliderThumb = platformResource( 634 static Image* mediaVolumeSliderThumb = platformResource(
633 "mediaplayerVolumeSliderThumb", 635 "mediaplayerVolumeSliderThumb",
634 "mediaplayerVolumeSliderThumbNew"); 636 "mediaplayerVolumeSliderThumbNew");
635 int width = 0; 637 int width = 0;
(...skipping 17 matching lines...) Expand all
653 } 655 }
654 656
655 float zoomLevel = style.effectiveZoom(); 657 float zoomLevel = style.effectiveZoom();
656 if (thumbImage) { 658 if (thumbImage) {
657 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed)); 659 style.setWidth(Length(static_cast<int>(width * zoomLevel), Fixed));
658 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed)); 660 style.setHeight(Length(static_cast<int>(height * zoomLevel), Fixed));
659 } 661 }
660 } 662 }
661 663
662 } // namespace blink 664 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/mediaControlsAndroidNew.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698