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

Side by Side Diff: Source/core/rendering/RenderThemeChromiumDefault.cpp

Issue 14859003: Remove the compile time flag for DATALIST Element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporate tkent's comments Created 7 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. 2 * Copyright (C) 2007 Apple Inc.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2008 Collabora Ltd. 4 * Copyright (C) 2008 Collabora Ltd.
5 * Copyright (C) 2008, 2009 Google Inc. 5 * Copyright (C) 2008, 2009 Google Inc.
6 * Copyright (C) 2009 Kenneth Rohde Christiansen 6 * Copyright (C) 2009 Kenneth Rohde Christiansen
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details. 16 * Library General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Library General Public License 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 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, 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA. 21 * Boston, MA 02110-1301, USA.
22 * 22 *
23 */ 23 */
24 24
25 #include "config.h" 25 #include "config.h"
26 #include "core/rendering/RenderThemeChromiumDefault.h" 26 #include "core/rendering/RenderThemeChromiumDefault.h"
27 27
28 #include "CSSValueKeywords.h" 28 #include "CSSValueKeywords.h"
29 #include "RuntimeEnabledFeatures.h"
tkent 2013/05/21 21:05:44 You don't need to include this.
29 #include "UserAgentStyleSheets.h" 30 #include "UserAgentStyleSheets.h"
30 #include "core/platform/ScrollbarTheme.h" 31 #include "core/platform/ScrollbarTheme.h"
31 #include "core/platform/graphics/Color.h" 32 #include "core/platform/graphics/Color.h"
32 #include "core/platform/graphics/GraphicsContext.h" 33 #include "core/platform/graphics/GraphicsContext.h"
33 #include "core/platform/graphics/GraphicsContextStateSaver.h" 34 #include "core/platform/graphics/GraphicsContextStateSaver.h"
34 #include "core/rendering/PaintInfo.h" 35 #include "core/rendering/PaintInfo.h"
35 #include "core/rendering/RenderObject.h" 36 #include "core/rendering/RenderObject.h"
36 #include "core/rendering/RenderProgress.h" 37 #include "core/rendering/RenderProgress.h"
37 #include "core/rendering/RenderSlider.h" 38 #include "core/rendering/RenderSlider.h"
38 #include <public/default/WebThemeEngine.h> 39 #include <public/default/WebThemeEngine.h>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (cssValueId == CSSValueButtonface) 98 if (cssValueId == CSSValueButtonface)
98 return defaultButtonGrayColor; 99 return defaultButtonGrayColor;
99 if (cssValueId == CSSValueMenu) 100 if (cssValueId == CSSValueMenu)
100 return defaultMenuColor; 101 return defaultMenuColor;
101 return RenderTheme::systemColor(cssValueId); 102 return RenderTheme::systemColor(cssValueId);
102 } 103 }
103 104
104 String RenderThemeChromiumDefault::extraDefaultStyleSheet() 105 String RenderThemeChromiumDefault::extraDefaultStyleSheet()
105 { 106 {
106 #if !OS(WINDOWS) 107 #if !OS(WINDOWS)
107 return RenderThemeChromiumSkia::extraDefaultStyleSheet() + 108 return RenderTheme::extraDefaultStyleSheet() +
108 String(themeChromiumLinuxUserAgentStyleSheet, sizeof(themeChromiumLin uxUserAgentStyleSheet)); 109 RenderThemeChromiumSkia::extraDefaultStyleSheet() +
110 String(themeChromiumLinuxUserAgentStyleSheet, sizeof(themeChromiumLinuxU serAgentStyleSheet));
109 #else 111 #else
110 return RenderThemeChromiumSkia::extraDefaultStyleSheet(); 112 return RenderTheme::extraDefaultStyleSheet() +
113 RenderThemeChromiumSkia::extraDefaultStyleSheet();
111 #endif 114 #endif
112 } 115 }
113 116
114 bool RenderThemeChromiumDefault::controlSupportsTints(const RenderObject* o) con st 117 bool RenderThemeChromiumDefault::controlSupportsTints(const RenderObject* o) con st
115 { 118 {
116 return isEnabled(o); 119 return isEnabled(o);
117 } 120 }
118 121
119 Color RenderThemeChromiumDefault::activeListBoxSelectionBackgroundColor() const 122 Color RenderThemeChromiumDefault::activeListBoxSelectionBackgroundColor() const
120 { 123 {
(...skipping 28 matching lines...) Expand all
149 Color RenderThemeChromiumDefault::platformActiveSelectionForegroundColor() const 152 Color RenderThemeChromiumDefault::platformActiveSelectionForegroundColor() const
150 { 153 {
151 return m_activeSelectionForegroundColor; 154 return m_activeSelectionForegroundColor;
152 } 155 }
153 156
154 Color RenderThemeChromiumDefault::platformInactiveSelectionForegroundColor() con st 157 Color RenderThemeChromiumDefault::platformInactiveSelectionForegroundColor() con st
155 { 158 {
156 return m_inactiveSelectionForegroundColor; 159 return m_inactiveSelectionForegroundColor;
157 } 160 }
158 161
159 #if ENABLE(DATALIST_ELEMENT)
160 IntSize RenderThemeChromiumDefault::sliderTickSize() const 162 IntSize RenderThemeChromiumDefault::sliderTickSize() const
161 { 163 {
162 return IntSize(1, 6); 164 return IntSize(1, 6);
163 } 165 }
164 166
165 int RenderThemeChromiumDefault::sliderTickOffsetFromTrackCenter() const 167 int RenderThemeChromiumDefault::sliderTickOffsetFromTrackCenter() const
166 { 168 {
167 return -16; 169 return -16;
168 } 170 }
169 #endif
170 171
171 void RenderThemeChromiumDefault::adjustSliderThumbSize(RenderStyle* style, Eleme nt* element) const 172 void RenderThemeChromiumDefault::adjustSliderThumbSize(RenderStyle* style, Eleme nt* element) const
172 { 173 {
173 IntSize size = WebKit::Platform::current()->themeEngine()->getSize(WebKit::W ebThemeEngine::PartSliderThumb); 174 IntSize size = WebKit::Platform::current()->themeEngine()->getSize(WebKit::W ebThemeEngine::PartSliderThumb);
174 float zoomLevel = style->effectiveZoom(); 175 float zoomLevel = style->effectiveZoom();
175 if (style->appearance() == SliderThumbHorizontalPart) { 176 if (style->appearance() == SliderThumbHorizontalPart) {
176 style->setWidth(Length(size.width() * zoomLevel, Fixed)); 177 style->setWidth(Length(size.width() * zoomLevel, Fixed));
177 style->setHeight(Length(size.height() * zoomLevel, Fixed)); 178 style->setHeight(Length(size.height() * zoomLevel, Fixed));
178 } else if (style->appearance() == SliderThumbVerticalPart) { 179 } else if (style->appearance() == SliderThumbVerticalPart) {
179 style->setWidth(Length(size.height() * zoomLevel, Fixed)); 180 style->setWidth(Length(size.height() * zoomLevel, Fixed));
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 WebKit::Platform::current()->themeEngine()->paint(canvas, WebKit::WebThemeEn gine::PartMenuList, getWebThemeState(this, o), WebKit::WebRect(rect), &extraPara ms); 331 WebKit::Platform::current()->themeEngine()->paint(canvas, WebKit::WebThemeEn gine::PartMenuList, getWebThemeState(this, o), WebKit::WebRect(rect), &extraPara ms);
331 return false; 332 return false;
332 } 333 }
333 334
334 bool RenderThemeChromiumDefault::paintSliderTrack(RenderObject* o, const PaintIn fo& i, const IntRect& rect) 335 bool RenderThemeChromiumDefault::paintSliderTrack(RenderObject* o, const PaintIn fo& i, const IntRect& rect)
335 { 336 {
336 WebKit::WebThemeEngine::ExtraParams extraParams; 337 WebKit::WebThemeEngine::ExtraParams extraParams;
337 WebKit::WebCanvas* canvas = i.context->canvas(); 338 WebKit::WebCanvas* canvas = i.context->canvas();
338 extraParams.slider.vertical = o->style()->appearance() == SliderVerticalPart ; 339 extraParams.slider.vertical = o->style()->appearance() == SliderVerticalPart ;
339 340
340 #if ENABLE(DATALIST_ELEMENT)
341 paintSliderTicks(o, i, rect); 341 paintSliderTicks(o, i, rect);
342 #endif
343 342
344 float zoomLevel = o->style()->effectiveZoom(); 343 float zoomLevel = o->style()->effectiveZoom();
345 GraphicsContextStateSaver stateSaver(*i.context); 344 GraphicsContextStateSaver stateSaver(*i.context);
346 IntRect unzoomedRect = rect; 345 IntRect unzoomedRect = rect;
347 if (zoomLevel != 1) { 346 if (zoomLevel != 1) {
348 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel); 347 unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
349 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel); 348 unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
350 i.context->translate(unzoomedRect.x(), unzoomedRect.y()); 349 i.context->translate(unzoomedRect.x(), unzoomedRect.y());
351 i.context->scale(FloatSize(zoomLevel, zoomLevel)); 350 i.context->scale(FloatSize(zoomLevel, zoomLevel));
352 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y()); 351 i.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 WebKit::Platform::current()->themeEngine()->paint(canvas, WebKit::WebThemeEn gine::PartProgressBar, getWebThemeState(this, o), WebKit::WebRect(rect), &extraP arams); 417 WebKit::Platform::current()->themeEngine()->paint(canvas, WebKit::WebThemeEn gine::PartProgressBar, getWebThemeState(this, o), WebKit::WebRect(rect), &extraP arams);
419 return false; 418 return false;
420 } 419 }
421 420
422 bool RenderThemeChromiumDefault::shouldOpenPickerWithF4Key() const 421 bool RenderThemeChromiumDefault::shouldOpenPickerWithF4Key() const
423 { 422 {
424 return true; 423 return true;
425 } 424 }
426 425
427 } // namespace WebCore 426 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698