1/*
2 * This file is part of the WebKit project.
3 *
4 * Copyright (C) 2006 Apple Computer, Inc.
5 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
6 * Copyright (C) 2007 Holger Hans Peter Freyther
7 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
8 * Copyright (C) 2008, 2009 Google, Inc.
9 * All rights reserved.
10 * Copyright (C) 2009 Kenneth Rohde Christiansen
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20 * Library General Public License for more details.
21 *
22 * You should have received a copy of the GNU Library General Public License
23 * along with this library; see the file COPYING.LIB.  If not, write to
24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA.
26 *
27 */
28
29#ifndef RenderThemeChromiumDefault_h
30#define RenderThemeChromiumDefault_h
31
32#include "core/rendering/RenderThemeChromiumSkia.h"
33
34namespace blink {
35
36class RenderThemeChromiumDefault : public RenderThemeChromiumSkia {
37public:
38    static PassRefPtr<RenderTheme> create();
39    virtual String extraDefaultStyleSheet() OVERRIDE;
40
41    virtual Color systemColor(CSSValueID) const OVERRIDE;
42
43    virtual bool supportsFocusRing(const RenderStyle*) const OVERRIDE;
44
45    // List Box selection color
46    virtual Color activeListBoxSelectionBackgroundColor() const;
47    virtual Color activeListBoxSelectionForegroundColor() const;
48    virtual Color inactiveListBoxSelectionBackgroundColor() const;
49    virtual Color inactiveListBoxSelectionForegroundColor() const;
50
51    virtual Color platformActiveSelectionBackgroundColor() const OVERRIDE;
52    virtual Color platformInactiveSelectionBackgroundColor() const OVERRIDE;
53    virtual Color platformActiveSelectionForegroundColor() const OVERRIDE;
54    virtual Color platformInactiveSelectionForegroundColor() const OVERRIDE;
55
56    virtual IntSize sliderTickSize() const OVERRIDE;
57    virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE;
58    virtual void adjustSliderThumbSize(RenderStyle*, Element*) const OVERRIDE;
59
60    static void setCaretBlinkInterval(double);
61    virtual double caretBlinkIntervalInternal() const OVERRIDE;
62
63    virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
64    virtual void setCheckboxSize(RenderStyle*) const OVERRIDE;
65
66    virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
67    virtual void setRadioSize(RenderStyle*) const OVERRIDE;
68
69    virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
70    virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
71    virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
72    virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
73    virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
74    virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
75
76    virtual void adjustInnerSpinButtonStyle(RenderStyle*, Element*) const OVERRIDE;
77    virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
78
79    virtual bool popsMenuBySpaceKey() const OVERRIDE FINAL { return true; }
80    virtual bool popsMenuByReturnKey() const OVERRIDE FINAL { return true; }
81    virtual bool popsMenuByAltDownUpOrF4Key() const OVERRIDE { return true; }
82
83    virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE;
84
85    virtual bool shouldOpenPickerWithF4Key() const OVERRIDE;
86
87    static void setSelectionColors(unsigned activeBackgroundColor, unsigned activeForegroundColor, unsigned inactiveBackgroundColor, unsigned inactiveForegroundColor);
88
89protected:
90    RenderThemeChromiumDefault();
91    virtual ~RenderThemeChromiumDefault();
92    virtual bool shouldUseFallbackTheme(RenderStyle*) const OVERRIDE;
93
94private:
95    static double m_caretBlinkInterval;
96
97    static unsigned m_activeSelectionBackgroundColor;
98    static unsigned m_activeSelectionForegroundColor;
99    static unsigned m_inactiveSelectionBackgroundColor;
100    static unsigned m_inactiveSelectionForegroundColor;
101};
102
103} // namespace blink
104
105#endif // RenderThemeChromiumDefault_h
106