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

Side by Side Diff: Source/core/rendering/RenderThemeChromiumMac.mm

Issue 20061003: Move isValid/isCurrentColor from Color to StyleColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 387 }
388 388
389 Color RenderThemeChromiumMac::systemColor(CSSValueID cssValueId) const 389 Color RenderThemeChromiumMac::systemColor(CSSValueID cssValueId) const
390 { 390 {
391 { 391 {
392 HashMap<int, RGBA32>::iterator it = m_systemColorCache.find(cssValueId); 392 HashMap<int, RGBA32>::iterator it = m_systemColorCache.find(cssValueId);
393 if (it != m_systemColorCache.end()) 393 if (it != m_systemColorCache.end())
394 return it->value; 394 return it->value;
395 } 395 }
396 396
397 Color color; 397 Color color = Color::transparent;
398 switch (cssValueId) { 398 switch (cssValueId) {
399 case CSSValueActiveborder: 399 case CSSValueActiveborder:
400 color = convertNSColorToColor([NSColor keyboardFocusIndicatorColor]) ; 400 color = convertNSColorToColor([NSColor keyboardFocusIndicatorColor]) ;
401 break; 401 break;
402 case CSSValueActivecaption: 402 case CSSValueActivecaption:
403 color = convertNSColorToColor([NSColor windowFrameTextColor]); 403 color = convertNSColorToColor([NSColor windowFrameTextColor]);
404 break; 404 break;
405 case CSSValueAppworkspace: 405 case CSSValueAppworkspace:
406 color = convertNSColorToColor([NSColor headerColor]); 406 color = convertNSColorToColor([NSColor headerColor]);
407 break; 407 break;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 case CSSValueWindowframe: 488 case CSSValueWindowframe:
489 color = convertNSColorToColor([NSColor windowFrameColor]); 489 color = convertNSColorToColor([NSColor windowFrameColor]);
490 break; 490 break;
491 case CSSValueWindowtext: 491 case CSSValueWindowtext:
492 color = convertNSColorToColor([NSColor windowFrameTextColor]); 492 color = convertNSColorToColor([NSColor windowFrameTextColor]);
493 break; 493 break;
494 default: 494 default:
495 break; 495 break;
496 } 496 }
497 497
498 if (!color.isValid()) 498 if (!color.alpha())
499 color = RenderTheme::systemColor(cssValueId); 499 color = RenderTheme::systemColor(cssValueId);
500 500
501 if (color.isValid()) 501 if (color.alpha())
502 m_systemColorCache.set(cssValueId, color.rgb()); 502 m_systemColorCache.set(cssValueId, color.rgb());
503 503
504 return color; 504 return color;
505 } 505 }
506 506
507 bool RenderThemeChromiumMac::isControlStyled(const RenderStyle* style, const Cac hedUAStyle& uaStyle) const 507 bool RenderThemeChromiumMac::isControlStyled(const RenderStyle* style, const Cac hedUAStyle& uaStyle) const
508 { 508 {
509 if (style->appearance() == TextFieldPart || style->appearance() == TextAreaP art || style->appearance() == ListboxPart) 509 if (style->appearance() == TextFieldPart || style->appearance() == TextAreaP art || style->appearance() == ListboxPart)
510 return style->border() != uaStyle.border || style->boxShadow(); 510 return style->border() != uaStyle.border || style->boxShadow();
511 511
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 float arrowHeight = baseArrowHeight * fontScale; 1240 float arrowHeight = baseArrowHeight * fontScale;
1241 float arrowWidth = baseArrowWidth * fontScale; 1241 float arrowWidth = baseArrowWidth * fontScale;
1242 float leftEdge = bounds.maxX() - arrowPaddingRight * o->style()->effectiveZo om() - arrowWidth; 1242 float leftEdge = bounds.maxX() - arrowPaddingRight * o->style()->effectiveZo om() - arrowWidth;
1243 float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale; 1243 float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale;
1244 1244
1245 if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style()->effectiveZo om()) 1245 if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style()->effectiveZo om())
1246 return false; 1246 return false;
1247 1247
1248 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1248 GraphicsContextStateSaver stateSaver(*paintInfo.context);
1249 1249
1250 paintInfo.context->setFillColor(o->style()->visitedDependentColor(CSSPropert yColor)); 1250 paintInfo.context->setFillColor(o->resolveColor(CSSPropertyColor));
1251 paintInfo.context->setStrokeStyle(NoStroke); 1251 paintInfo.context->setStrokeStyle(NoStroke);
1252 1252
1253 FloatPoint arrow1[3]; 1253 FloatPoint arrow1[3];
1254 arrow1[0] = FloatPoint(leftEdge, centerY - spaceBetweenArrows / 2.0f); 1254 arrow1[0] = FloatPoint(leftEdge, centerY - spaceBetweenArrows / 2.0f);
1255 arrow1[1] = FloatPoint(leftEdge + arrowWidth, centerY - spaceBetweenArrows / 2.0f); 1255 arrow1[1] = FloatPoint(leftEdge + arrowWidth, centerY - spaceBetweenArrows / 2.0f);
1256 arrow1[2] = FloatPoint(leftEdge + arrowWidth / 2.0f, centerY - spaceBetweenA rrows / 2.0f - arrowHeight); 1256 arrow1[2] = FloatPoint(leftEdge + arrowWidth / 2.0f, centerY - spaceBetweenA rrows / 2.0f - arrowHeight);
1257 1257
1258 // Draw the top arrow 1258 // Draw the top arrow
1259 paintInfo.context->drawConvexPolygon(3, arrow1, true); 1259 paintInfo.context->drawConvexPolygon(3, arrow1, true);
1260 1260
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
2016 2016
2017 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const 2017 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const
2018 { 2018 {
2019 ControlPart part = style->appearance(); 2019 ControlPart part = style->appearance();
2020 if (part == CheckboxPart || part == RadioPart) 2020 if (part == CheckboxPart || part == RadioPart)
2021 return style->effectiveZoom() != 1; 2021 return style->effectiveZoom() != 1;
2022 return false; 2022 return false;
2023 } 2023 }
2024 2024
2025 } // namespace WebCore 2025 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698