OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1774 return false; | 1774 return false; |
1775 } | 1775 } |
1776 | 1776 |
1777 bool RenderThemeMac::paintMediaMuteButton(RenderObject* o, const PaintInfo& pain
tInfo, const IntRect& r) | 1777 bool RenderThemeMac::paintMediaMuteButton(RenderObject* o, const PaintInfo& pain
tInfo, const IntRect& r) |
1778 { | 1778 { |
1779 Node* node = o->node(); | 1779 Node* node = o->node(); |
1780 Node* mediaNode = node ? node->shadowAncestorNode() : 0; | 1780 Node* mediaNode = node ? node->shadowAncestorNode() : 0; |
1781 if (!mediaNode || (!mediaNode->hasTagName(videoTag) && !mediaNode->hasTagNam
e(audioTag))) | 1781 if (!mediaNode || (!mediaNode->hasTagName(videoTag) && !mediaNode->hasTagNam
e(audioTag))) |
1782 return false; | 1782 return false; |
1783 | 1783 |
1784 if (MediaControlMuteButtonElement* btn = static_cast<MediaControlMuteButtonE
lement*>(node)) { | 1784 if (node->isMediaControlElement()) { |
1785 LocalCurrentGraphicsContext localContext(paintInfo.context); | 1785 LocalCurrentGraphicsContext localContext(paintInfo.context); |
1786 wkDrawMediaUIPart(btn->displayType(), mediaControllerTheme(), localConte
xt.cgContext(), r, getMediaUIPartStateFlags(node)); | 1786 wkDrawMediaUIPart(mediaControlElementType(node), mediaControllerTheme(),
localContext.cgContext(), r, getMediaUIPartStateFlags(node)); |
1787 | |
1788 } | 1787 } |
1789 return false; | 1788 return false; |
1790 } | 1789 } |
1791 | 1790 |
1792 bool RenderThemeMac::paintMediaPlayButton(RenderObject* o, const PaintInfo& pain
tInfo, const IntRect& r) | 1791 bool RenderThemeMac::paintMediaPlayButton(RenderObject* o, const PaintInfo& pain
tInfo, const IntRect& r) |
1793 { | 1792 { |
1794 Node* node = o->node(); | 1793 Node* node = o->node(); |
1795 Node* mediaNode = node ? node->shadowAncestorNode() : 0; | 1794 Node* mediaNode = node ? node->shadowAncestorNode() : 0; |
1796 if (!mediaNode || (!mediaNode->hasTagName(videoTag) && !mediaNode->hasTagNam
e(audioTag))) | 1795 if (!mediaNode || (!mediaNode->hasTagName(videoTag) && !mediaNode->hasTagNam
e(audioTag))) |
1797 return false; | 1796 return false; |
1798 | 1797 |
1799 if (MediaControlPlayButtonElement* btn = static_cast<MediaControlPlayButtonE
lement*>(node)) { | 1798 if (node->isMediaControlElement()) { |
1800 LocalCurrentGraphicsContext localContext(paintInfo.context); | 1799 LocalCurrentGraphicsContext localContext(paintInfo.context); |
1801 wkDrawMediaUIPart(btn->displayType(), mediaControllerTheme(), localConte
xt.cgContext(), r, getMediaUIPartStateFlags(node)); | 1800 wkDrawMediaUIPart(mediaControlElementType(node), mediaControllerTheme(),
localContext.cgContext(), r, getMediaUIPartStateFlags(node)); |
1802 } | 1801 } |
1803 return false; | 1802 return false; |
1804 } | 1803 } |
1805 | 1804 |
1806 bool RenderThemeMac::paintMediaSeekBackButton(RenderObject* o, const PaintInfo&
paintInfo, const IntRect& r) | 1805 bool RenderThemeMac::paintMediaSeekBackButton(RenderObject* o, const PaintInfo&
paintInfo, const IntRect& r) |
1807 { | 1806 { |
1808 Node* node = o->node(); | 1807 Node* node = o->node(); |
1809 if (!node) | 1808 if (!node) |
1810 return false; | 1809 return false; |
1811 | 1810 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 if (!node) | 1880 if (!node) |
1882 return false; | 1881 return false; |
1883 | 1882 |
1884 LocalCurrentGraphicsContext localContext(paintInfo.context); | 1883 LocalCurrentGraphicsContext localContext(paintInfo.context); |
1885 wkDrawMediaUIPart(MediaReturnToRealtimeButton, mediaControllerTheme(), local
Context.cgContext(), r, getMediaUIPartStateFlags(node)); | 1884 wkDrawMediaUIPart(MediaReturnToRealtimeButton, mediaControllerTheme(), local
Context.cgContext(), r, getMediaUIPartStateFlags(node)); |
1886 return false; | 1885 return false; |
1887 } | 1886 } |
1888 | 1887 |
1889 bool RenderThemeMac::paintMediaToggleClosedCaptionsButton(RenderObject* o, const
PaintInfo& paintInfo, const IntRect& r) | 1888 bool RenderThemeMac::paintMediaToggleClosedCaptionsButton(RenderObject* o, const
PaintInfo& paintInfo, const IntRect& r) |
1890 { | 1889 { |
1891 HTMLInputElement* node = static_cast<HTMLInputElement*>(o->node()); | 1890 Node* node = o->node(); |
1892 if (!node) | 1891 if (!node) |
1893 return false; | 1892 return false; |
1894 | 1893 if (!node->isMediaControlElement()) |
1895 MediaControlToggleClosedCaptionsButtonElement* btn = static_cast<MediaContro
lToggleClosedCaptionsButtonElement*>(node); | |
1896 if (!btn) | |
1897 return false; | 1894 return false; |
1898 | 1895 |
1899 LocalCurrentGraphicsContext localContext(paintInfo.context); | 1896 LocalCurrentGraphicsContext localContext(paintInfo.context); |
1900 wkDrawMediaUIPart(btn->displayType(), mediaControllerTheme(), localContext.c
gContext(), r, getMediaUIPartStateFlags(node)); | 1897 wkDrawMediaUIPart(mediaControlElementType(node), mediaControllerTheme(), loc
alContext.cgContext(), r, getMediaUIPartStateFlags(node)); |
1901 | |
1902 return false; | 1898 return false; |
1903 } | 1899 } |
1904 | 1900 |
1905 bool RenderThemeMac::paintMediaControlsBackground(RenderObject* o, const PaintIn
fo& paintInfo, const IntRect& r) | 1901 bool RenderThemeMac::paintMediaControlsBackground(RenderObject* o, const PaintIn
fo& paintInfo, const IntRect& r) |
1906 { | 1902 { |
1907 Node* node = o->node(); | 1903 Node* node = o->node(); |
1908 if (!node) | 1904 if (!node) |
1909 return false; | 1905 return false; |
1910 | 1906 |
1911 LocalCurrentGraphicsContext localContext(paintInfo.context); | 1907 LocalCurrentGraphicsContext localContext(paintInfo.context); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2102 strToTruncate = fileButtonNoFileSelectedLabel(); | 2098 strToTruncate = fileButtonNoFileSelectedLabel(); |
2103 else if (filenames.size() == 1) | 2099 else if (filenames.size() == 1) |
2104 strToTruncate = [[NSFileManager defaultManager] displayNameAtPath:(filen
ames[0])]; | 2100 strToTruncate = [[NSFileManager defaultManager] displayNameAtPath:(filen
ames[0])]; |
2105 else | 2101 else |
2106 return StringTruncator::rightTruncate(multipleFileUploadText(filenames.s
ize()), width, font, StringTruncator::EnableRoundingHacks); | 2102 return StringTruncator::rightTruncate(multipleFileUploadText(filenames.s
ize()), width, font, StringTruncator::EnableRoundingHacks); |
2107 | 2103 |
2108 return StringTruncator::centerTruncate(strToTruncate, width, font, StringTru
ncator::EnableRoundingHacks); | 2104 return StringTruncator::centerTruncate(strToTruncate, width, font, StringTru
ncator::EnableRoundingHacks); |
2109 } | 2105 } |
2110 | 2106 |
2111 } // namespace WebCore | 2107 } // namespace WebCore |
OLD | NEW |