| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "core/layout/LayoutThemeMobile.h" | 26 #include "core/layout/LayoutThemeMobile.h" |
| 27 | 27 |
| 28 #include "core/style/ComputedStyle.h" | 28 #include "core/style/ComputedStyle.h" |
| 29 #include "platform/LayoutTestSupport.h" | 29 #include "platform/LayoutTestSupport.h" |
| 30 #include "platform/PlatformResourceLoader.h" | 30 #include "platform/PlatformResourceLoader.h" |
| 31 #include "platform/RuntimeEnabledFeatures.h" | |
| 32 #include "public/platform/Platform.h" | 31 #include "public/platform/Platform.h" |
| 33 #include "public/platform/WebThemeEngine.h" | 32 #include "public/platform/WebThemeEngine.h" |
| 34 | 33 |
| 35 namespace blink { | 34 namespace blink { |
| 36 | 35 |
| 37 PassRefPtr<LayoutTheme> LayoutThemeMobile::create() { | 36 PassRefPtr<LayoutTheme> LayoutThemeMobile::create() { |
| 38 return adoptRef(new LayoutThemeMobile()); | 37 return adoptRef(new LayoutThemeMobile()); |
| 39 } | 38 } |
| 40 | 39 |
| 41 LayoutThemeMobile::~LayoutThemeMobile() {} | 40 LayoutThemeMobile::~LayoutThemeMobile() {} |
| 42 | 41 |
| 43 String LayoutThemeMobile::extraDefaultStyleSheet() { | 42 String LayoutThemeMobile::extraDefaultStyleSheet() { |
| 44 return LayoutThemeDefault::extraDefaultStyleSheet() + | 43 return LayoutThemeDefault::extraDefaultStyleSheet() + |
| 45 loadResourceAsASCIIString("themeChromiumLinux.css") + | 44 loadResourceAsASCIIString("themeChromiumLinux.css") + |
| 46 loadResourceAsASCIIString("themeChromiumAndroid.css"); | 45 loadResourceAsASCIIString("themeChromiumAndroid.css"); |
| 47 } | 46 } |
| 48 | 47 |
| 49 String LayoutThemeMobile::extraMediaControlsStyleSheet() { | 48 String LayoutThemeMobile::extraMediaControlsStyleSheet() { |
| 50 return loadResourceAsASCIIString( | 49 return loadResourceAsASCIIString("mediaControlsAndroidNew.css"); |
| 51 RuntimeEnabledFeatures::newMediaPlaybackUiEnabled() | |
| 52 ? "mediaControlsAndroidNew.css" | |
| 53 : "mediaControlsAndroid.css"); | |
| 54 } | 50 } |
| 55 | 51 |
| 56 String LayoutThemeMobile::extraFullscreenStyleSheet() { | 52 String LayoutThemeMobile::extraFullscreenStyleSheet() { |
| 57 return loadResourceAsASCIIString("fullscreenAndroid.css"); | 53 return loadResourceAsASCIIString("fullscreenAndroid.css"); |
| 58 } | 54 } |
| 59 | 55 |
| 60 void LayoutThemeMobile::adjustInnerSpinButtonStyle(ComputedStyle& style) const { | 56 void LayoutThemeMobile::adjustInnerSpinButtonStyle(ComputedStyle& style) const { |
| 61 if (LayoutTestSupport::isRunningLayoutTest()) { | 57 if (LayoutTestSupport::isRunningLayoutTest()) { |
| 62 // Match Linux spin button style in layout tests. | 58 // Match Linux spin button style in layout tests. |
| 63 // FIXME: Consider removing the conditional if a future Android theme | 59 // FIXME: Consider removing the conditional if a future Android theme |
| (...skipping 11 matching lines...) Expand all Loading... |
| 75 #if OS(MACOSX) | 71 #if OS(MACOSX) |
| 76 // Mac WebThemeEngine cannot handle these controls. | 72 // Mac WebThemeEngine cannot handle these controls. |
| 77 ControlPart part = style.appearance(); | 73 ControlPart part = style.appearance(); |
| 78 if (part == CheckboxPart || part == RadioPart) | 74 if (part == CheckboxPart || part == RadioPart) |
| 79 return true; | 75 return true; |
| 80 #endif | 76 #endif |
| 81 return LayoutThemeDefault::shouldUseFallbackTheme(style); | 77 return LayoutThemeDefault::shouldUseFallbackTheme(style); |
| 82 } | 78 } |
| 83 | 79 |
| 84 } // namespace blink | 80 } // namespace blink |
| OLD | NEW |