Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: Source/core/layout/LayoutThemeChromiumSkia.h

Issue 894393003: Constify and use reference for RenderStyle in LayoutTheme (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix Mac take I. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * This file is part of the WebKit project. 2 * This file is part of the WebKit project.
3 * 3 *
4 * Copyright (C) 2006 Apple Computer, Inc. 4 * Copyright (C) 2006 Apple Computer, Inc.
5 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com 5 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
6 * Copyright (C) 2007 Holger Hans Peter Freyther 6 * Copyright (C) 2007 Holger Hans Peter Freyther
7 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
8 * Copyright (C) 2008, 2009 Google, Inc. 8 * Copyright (C) 2008, 2009 Google, Inc.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
(...skipping 30 matching lines...) Expand all
41 41
42 virtual String extraDefaultStyleSheet() override; 42 virtual String extraDefaultStyleSheet() override;
43 virtual String extraQuirksStyleSheet() override; 43 virtual String extraQuirksStyleSheet() override;
44 44
45 virtual Color platformTapHighlightColor() const override 45 virtual Color platformTapHighlightColor() const override
46 { 46 {
47 return Color(defaultTapHighlightColor); 47 return Color(defaultTapHighlightColor);
48 } 48 }
49 49
50 // A method asking if the theme's controls actually care about redrawing whe n hovered. 50 // A method asking if the theme's controls actually care about redrawing whe n hovered.
51 virtual bool supportsHover(const RenderStyle*) const override final; 51 virtual bool supportsHover(const RenderStyle&) const override final;
52 52
53 // A method asking if the theme is able to draw the focus ring. 53 // A method asking if the theme is able to draw the focus ring.
54 virtual bool supportsFocusRing(const RenderStyle*) const override; 54 virtual bool supportsFocusRing(const RenderStyle&) const override;
55 55
56 // The platform selection color. 56 // The platform selection color.
57 virtual Color platformActiveSelectionBackgroundColor() const override; 57 virtual Color platformActiveSelectionBackgroundColor() const override;
58 virtual Color platformInactiveSelectionBackgroundColor() const override; 58 virtual Color platformInactiveSelectionBackgroundColor() const override;
59 virtual Color platformActiveSelectionForegroundColor() const override; 59 virtual Color platformActiveSelectionForegroundColor() const override;
60 virtual Color platformInactiveSelectionForegroundColor() const override; 60 virtual Color platformInactiveSelectionForegroundColor() const override;
61 virtual Color platformFocusRingColor() const override; 61 virtual Color platformFocusRingColor() const override;
62 62
63 // To change the blink interval, override caretBlinkIntervalInternal instead of this one so that we may share layout test code an intercepts. 63 // To change the blink interval, override caretBlinkIntervalInternal instead of this one so that we may share layout test code an intercepts.
64 virtual double caretBlinkInterval() const override; 64 virtual double caretBlinkInterval() const override;
65 65
66 // System fonts. 66 // System fonts.
67 virtual void systemFont(CSSValueID systemFontID, FontStyle&, FontWeight&, fl oat& fontSize, AtomicString& fontFamily) const; 67 virtual void systemFont(CSSValueID systemFontID, FontStyle&, FontWeight&, fl oat& fontSize, AtomicString& fontFamily) const;
68 68
69 virtual int minimumMenuListSize(RenderStyle*) const override; 69 virtual int minimumMenuListSize(const RenderStyle&) const override;
70 70
71 virtual void setCheckboxSize(RenderStyle*) const override; 71 virtual void setCheckboxSize(RenderStyle&) const override;
72 72
73 virtual void setRadioSize(RenderStyle*) const override; 73 virtual void setRadioSize(RenderStyle&) const override;
74 74
75 virtual void adjustButtonStyle(RenderStyle*, Element*) const override; 75 virtual void adjustButtonStyle(RenderStyle&, Element*) const override;
76 76
77 virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&) override; 77 virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&) override;
78 78
79 virtual void adjustSearchFieldStyle(RenderStyle*, Element*) const override; 79 virtual void adjustSearchFieldStyle(RenderStyle&, Element*) const override;
80 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect &) override; 80 virtual bool paintSearchField(RenderObject*, const PaintInfo&, const IntRect &) override;
81 81
82 virtual void adjustSearchFieldCancelButtonStyle(RenderStyle*, Element*) cons t override; 82 virtual void adjustSearchFieldCancelButtonStyle(RenderStyle&, Element*) cons t override;
83 virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, c onst IntRect&) override; 83 virtual bool paintSearchFieldCancelButton(RenderObject*, const PaintInfo&, c onst IntRect&) override;
84 84
85 virtual void adjustSearchFieldDecorationStyle(RenderStyle*, Element*) const override; 85 virtual void adjustSearchFieldDecorationStyle(RenderStyle&, Element*) const override;
86 86
87 virtual void adjustSearchFieldResultsDecorationStyle(RenderStyle*, Element*) const override; 87 virtual void adjustSearchFieldResultsDecorationStyle(RenderStyle&, Element*) const override;
88 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInf o&, const IntRect&) override; 88 virtual bool paintSearchFieldResultsDecoration(RenderObject*, const PaintInf o&, const IntRect&) override;
89 89
90 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const In tRect&) override; 90 virtual bool paintMediaSliderTrack(RenderObject*, const PaintInfo&, const In tRect&) override;
91 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, co nst IntRect&) override; 91 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, co nst IntRect&) override;
92 virtual void adjustSliderThumbSize(RenderStyle*, Element*) const override; 92 virtual void adjustSliderThumbSize(RenderStyle&, Element*) const override;
93 virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const In tRect&) override; 93 virtual bool paintMediaSliderThumb(RenderObject*, const PaintInfo&, const In tRect&) override;
94 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint Info&, const IntRect&) override; 94 virtual bool paintMediaToggleClosedCaptionsButton(RenderObject*, const Paint Info&, const IntRect&) override;
95 virtual bool paintMediaCastButton(RenderObject*, const PaintInfo&, const Int Rect&) override; 95 virtual bool paintMediaCastButton(RenderObject*, const PaintInfo&, const Int Rect&) override;
96 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co nst IntRect&) override; 96 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, co nst IntRect&) override;
97 virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const Int Rect&) override; 97 virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const Int Rect&) override;
98 virtual bool paintMediaOverlayPlayButton(RenderObject*, const PaintInfo&, co nst IntRect&) override; 98 virtual bool paintMediaOverlayPlayButton(RenderObject*, const PaintInfo&, co nst IntRect&) override;
99 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const Int Rect&) override; 99 virtual bool paintMediaMuteButton(RenderObject*, const PaintInfo&, const Int Rect&) override;
100 virtual String formatMediaControlsTime(float time) const override; 100 virtual String formatMediaControlsTime(float time) const override;
101 virtual String formatMediaControlsCurrentTime(float currentTime, float durat ion) const override; 101 virtual String formatMediaControlsCurrentTime(float currentTime, float durat ion) const override;
102 virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, con st IntRect&) override; 102 virtual bool paintMediaFullscreenButton(RenderObject*, const PaintInfo&, con st IntRect&) override;
103 103
104 // MenuList refers to an unstyled menulist (meaning a menulist without 104 // MenuList refers to an unstyled menulist (meaning a menulist without
105 // background-color or border set) and MenuListButton refers to a styled 105 // background-color or border set) and MenuListButton refers to a styled
106 // menulist (a menulist with background-color or border set). They have 106 // menulist (a menulist with background-color or border set). They have
107 // this distinction to support showing aqua style themes whenever they 107 // this distinction to support showing aqua style themes whenever they
108 // possibly can, which is something we don't want to replicate. 108 // possibly can, which is something we don't want to replicate.
109 // 109 //
110 // In short, we either go down the MenuList code path or the MenuListButton 110 // In short, we either go down the MenuList code path or the MenuListButton
111 // codepath. We never go down both. And in both cases, they render the 111 // codepath. We never go down both. And in both cases, they render the
112 // entire menulist. 112 // entire menulist.
113 virtual void adjustMenuListStyle(RenderStyle*, Element*) const override; 113 virtual void adjustMenuListStyle(RenderStyle&, Element*) const override;
114 virtual void adjustMenuListButtonStyle(RenderStyle*, Element*) const overrid e; 114 virtual void adjustMenuListButtonStyle(RenderStyle&, Element*) const overrid e;
115 virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntR ect&) override; 115 virtual bool paintMenuListButton(RenderObject*, const PaintInfo&, const IntR ect&) override;
116 116
117 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const override; 117 virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const override;
118 virtual double animationDurationForProgressBar(RenderProgress*) const overri de; 118 virtual double animationDurationForProgressBar(RenderProgress*) const overri de;
119 119
120 // These methods define the padding for the MenuList's inner block. 120 // These methods define the padding for the MenuList's inner block.
121 virtual int popupInternalPaddingLeft(RenderStyle*) const override; 121 virtual int popupInternalPaddingLeft(const RenderStyle&) const override;
122 virtual int popupInternalPaddingRight(RenderStyle*) const override; 122 virtual int popupInternalPaddingRight(const RenderStyle&) const override;
123 virtual int popupInternalPaddingTop(RenderStyle*) const override; 123 virtual int popupInternalPaddingTop(const RenderStyle&) const override;
124 virtual int popupInternalPaddingBottom(RenderStyle*) const override; 124 virtual int popupInternalPaddingBottom(const RenderStyle&) const override;
125 125
126 // Provide a way to pass the default font size from the Settings object 126 // Provide a way to pass the default font size from the Settings object
127 // to the render theme. FIXME: http://b/1129186 A cleaner way would be 127 // to the render theme. FIXME: http://b/1129186 A cleaner way would be
128 // to remove the default font size from this object and have callers 128 // to remove the default font size from this object and have callers
129 // that need the value to get it directly from the appropriate Settings 129 // that need the value to get it directly from the appropriate Settings
130 // object. 130 // object.
131 static void setDefaultFontSize(int); 131 static void setDefaultFontSize(int);
132 132
133 protected: 133 protected:
134 virtual double caretBlinkIntervalInternal() const; 134 virtual double caretBlinkIntervalInternal() const;
(...skipping 10 matching lines...) Expand all
145 ~DirectionFlippingScope(); 145 ~DirectionFlippingScope();
146 146
147 private: 147 private:
148 bool m_needsFlipping; 148 bool m_needsFlipping;
149 const PaintInfo& m_paintInfo; 149 const PaintInfo& m_paintInfo;
150 }; 150 };
151 151
152 private: 152 private:
153 virtual bool shouldShowPlaceholderWhenFocused() const override; 153 virtual bool shouldShowPlaceholderWhenFocused() const override;
154 154
155 int menuListInternalPadding(RenderStyle*, int paddingType) const; 155 int menuListInternalPadding(const RenderStyle&, int paddingType) const;
156 bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*); 156 bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*);
157 IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObjec t* partRenderer, LayoutRect partRect, const IntRect& localOffset) const; 157 IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObjec t* partRenderer, LayoutRect partRect, const IntRect& localOffset) const;
158 158
159 static const RGBA32 defaultTapHighlightColor = 0x2e000000; // 18% black. 159 static const RGBA32 defaultTapHighlightColor = 0x2e000000; // 18% black.
160 }; 160 };
161 161
162 } // namespace blink 162 } // namespace blink
163 163
164 #endif // LayoutThemeChromiumSkia_h 164 #endif // LayoutThemeChromiumSkia_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutThemeChromiumMac.mm ('k') | Source/core/layout/LayoutThemeChromiumSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698