| OLD | NEW |
| 1 /** | 1 /** |
| 2 * This file is part of the theme implementation for form controls in WebCore. | 2 * This file is part of the theme implementation for form controls in WebCore. |
| 3 * | 3 * |
| 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. | 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 | 219 |
| 220 String LayoutTheme::extraDefaultStyleSheet() | 220 String LayoutTheme::extraDefaultStyleSheet() |
| 221 { | 221 { |
| 222 StringBuilder runtimeCSS; | 222 StringBuilder runtimeCSS; |
| 223 if (RuntimeEnabledFeatures::contextMenuEnabled()) | 223 if (RuntimeEnabledFeatures::contextMenuEnabled()) |
| 224 runtimeCSS.appendLiteral("menu[type=\"popup\" i] { display: none; }"); | 224 runtimeCSS.appendLiteral("menu[type=\"popup\" i] { display: none; }"); |
| 225 return runtimeCSS.toString(); | 225 return runtimeCSS.toString(); |
| 226 } | 226 } |
| 227 | 227 |
| 228 static String formatChromiumMediaControlsTime(float time, float duration, bool i
ncludeSeparator) | 228 String LayoutTheme::formatChromiumMediaControlsTime(float time, float duration,
bool includeSeparator) |
| 229 { | 229 { |
| 230 if (!std::isfinite(time)) | 230 if (!std::isfinite(time)) |
| 231 time = 0; | 231 time = 0; |
| 232 if (!std::isfinite(duration)) | 232 if (!std::isfinite(duration)) |
| 233 duration = 0; | 233 duration = 0; |
| 234 int seconds = static_cast<int>(fabsf(time)); | 234 int seconds = static_cast<int>(fabsf(time)); |
| 235 int minutes = seconds / 60; | 235 int minutes = seconds / 60; |
| 236 int hours = seconds / (60 * 60); |
| 236 | 237 |
| 237 seconds %= 60; | 238 seconds %= 60; |
| 238 | 239 |
| 239 // duration defines the format of how the time is rendered | 240 // duration defines the format of how the time is rendered |
| 240 int durationSecs = static_cast<int>(fabsf(duration)); | 241 int durationSecs = static_cast<int>(fabsf(duration)); |
| 241 int durationMins = durationSecs / 60; | 242 int durationMins = durationSecs / 60; |
| 242 | 243 |
| 243 if (!RuntimeEnabledFeatures::newMediaPlaybackUiEnabled()) { | 244 if (!RuntimeEnabledFeatures::newMediaPlaybackUiEnabled()) { |
| 244 int hours = seconds / (60 * 60); | |
| 245 int durationHours = durationSecs / (60 * 60); | 245 int durationHours = durationSecs / (60 * 60); |
| 246 durationMins %= 60; | 246 durationMins %= 60; |
| 247 minutes %= 60; | 247 minutes %= 60; |
| 248 if (durationHours || hours) | 248 if (durationHours || hours) |
| 249 return String::format("%s%01d:%02d:%02d", (time < 0 ? "-" : ""), hou
rs, minutes, seconds); | 249 return String::format("%s%01d:%02d:%02d", (time < 0 ? "-" : ""), hou
rs, minutes, seconds); |
| 250 if (durationMins > 9) | 250 if (durationMins > 9) |
| 251 return String::format("%s%02d:%02d", (time < 0 ? "-" : ""), minutes,
seconds); | 251 return String::format("%s%02d:%02d", (time < 0 ? "-" : ""), minutes,
seconds); |
| 252 | 252 |
| 253 return String::format("%s%01d:%02d", (time < 0 ? "-" : ""), minutes, sec
onds); | 253 return String::format("%s%01d:%02d", (time < 0 ? "-" : ""), minutes, sec
onds); |
| 254 } | 254 } |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 | 937 |
| 938 // padding - not honored by WinIE, needs to be removed. | 938 // padding - not honored by WinIE, needs to be removed. |
| 939 style.resetPadding(); | 939 style.resetPadding(); |
| 940 | 940 |
| 941 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) | 941 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) |
| 942 // for now, we will not honor it. | 942 // for now, we will not honor it. |
| 943 style.resetBorder(); | 943 style.resetBorder(); |
| 944 } | 944 } |
| 945 | 945 |
| 946 } // namespace blink | 946 } // namespace blink |
| OLD | NEW |