1 /* 2 * Copyright (C) 2007 Apple Inc. 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2008 Collabora Ltd. 5 * Copyright (C) 2008, 2009 Google Inc. 6 * Copyright (C) 2009 Kenneth Rohde Christiansen 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Library General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Library General Public License for more details. 17 * 18 * You should have received a copy of the GNU Library General Public License 19 * along with this library; see the file COPYING.LIB. If not, write to 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 * Boston, MA 02110-1301, USA. 22 * 23 */ 24 25 #include "config.h" 26 #include "RenderThemeChromiumLinux.h" 27 28 #include "Color.h" 29 #include "CSSValueKeywords.h" 30 #include "RenderObject.h" 31 #include "UserAgentStyleSheets.h" 32 33 namespace WebCore { 34 create()35 PassRefPtr<RenderTheme> RenderThemeChromiumLinux::create() 36 { 37 return adoptRef(new RenderThemeChromiumLinux()); 38 } 39 themeForPage(Page * page)40 PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page) 41 { 42 static RenderTheme* rt = RenderThemeChromiumLinux::create().releaseRef(); 43 return rt; 44 } 45 RenderThemeChromiumLinux()46 RenderThemeChromiumLinux::RenderThemeChromiumLinux() 47 { 48 } 49 ~RenderThemeChromiumLinux()50 RenderThemeChromiumLinux::~RenderThemeChromiumLinux() 51 { 52 } 53 systemColor(int cssValueId) const54 Color RenderThemeChromiumLinux::systemColor(int cssValueId) const 55 { 56 static const Color linuxButtonGrayColor(0xffdddddd); 57 58 if (cssValueId == CSSValueButtonface) 59 return linuxButtonGrayColor; 60 return RenderTheme::systemColor(cssValueId); 61 } 62 extraDefaultStyleSheet()63 String RenderThemeChromiumLinux::extraDefaultStyleSheet() 64 { 65 return RenderThemeChromiumSkia::extraDefaultStyleSheet() + 66 String(themeChromiumLinuxUserAgentStyleSheet, sizeof(themeChromiumLinuxUserAgentStyleSheet)); 67 } 68 controlSupportsTints(const RenderObject * o) const69 bool RenderThemeChromiumLinux::controlSupportsTints(const RenderObject* o) const 70 { 71 return isEnabled(o); 72 } 73 activeListBoxSelectionBackgroundColor() const74 Color RenderThemeChromiumLinux::activeListBoxSelectionBackgroundColor() const 75 { 76 return Color(0x28, 0x28, 0x28); 77 } 78 activeListBoxSelectionForegroundColor() const79 Color RenderThemeChromiumLinux::activeListBoxSelectionForegroundColor() const 80 { 81 return Color::black; 82 } 83 inactiveListBoxSelectionBackgroundColor() const84 Color RenderThemeChromiumLinux::inactiveListBoxSelectionBackgroundColor() const 85 { 86 return Color(0xc8, 0xc8, 0xc8); 87 } 88 inactiveListBoxSelectionForegroundColor() const89 Color RenderThemeChromiumLinux::inactiveListBoxSelectionForegroundColor() const 90 { 91 return Color(0x32, 0x32, 0x32); 92 } 93 supportsControlTints() const94 bool RenderThemeChromiumLinux::supportsControlTints() const 95 { 96 return true; 97 } 98 99 } // namespace WebCore 100