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

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

Issue 738113003: Refactor RenderThemeChromiumDefault (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: FixGN build Created 6 years 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
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (theme->isPressed(o)) 68 if (theme->isPressed(o))
69 return WebThemeEngine::StatePressed; 69 return WebThemeEngine::StatePressed;
70 if (useMockTheme() && theme->isFocused(o)) 70 if (useMockTheme() && theme->isFocused(o))
71 return WebThemeEngine::StateFocused; 71 return WebThemeEngine::StateFocused;
72 if (theme->isHovered(o)) 72 if (theme->isHovered(o))
73 return WebThemeEngine::StateHover; 73 return WebThemeEngine::StateHover;
74 74
75 return WebThemeEngine::StateNormal; 75 return WebThemeEngine::StateNormal;
76 } 76 }
77 77
78 PassRefPtr<RenderTheme> RenderThemeChromiumDefault::create()
79 {
80 return adoptRef(new RenderThemeChromiumDefault());
81 }
82
83 // RenderTheme::theme for Android is defined in RenderThemeChromiumAndroid.cpp.
84 #if !OS(ANDROID)
85 RenderTheme& RenderTheme::theme()
86 {
87 DEFINE_STATIC_REF(RenderTheme, renderTheme, (RenderThemeChromiumDefault::cre ate()));
88 return *renderTheme;
89 }
90 #endif
91
92 RenderThemeChromiumDefault::RenderThemeChromiumDefault() 78 RenderThemeChromiumDefault::RenderThemeChromiumDefault()
93 { 79 {
94 m_caretBlinkInterval = RenderTheme::caretBlinkInterval(); 80 m_caretBlinkInterval = RenderTheme::caretBlinkInterval();
95 } 81 }
96 82
97 RenderThemeChromiumDefault::~RenderThemeChromiumDefault() 83 RenderThemeChromiumDefault::~RenderThemeChromiumDefault()
98 { 84 {
99 } 85 }
100 86
101 bool RenderThemeChromiumDefault::supportsFocusRing(const RenderStyle* style) con st 87 bool RenderThemeChromiumDefault::supportsFocusRing(const RenderStyle* style) con st
(...skipping 18 matching lines...) Expand all
120 return Color(0xc0, 0xc0, 0xc0); 106 return Color(0xc0, 0xc0, 0xc0);
121 return defaultButtonGrayColor; 107 return defaultButtonGrayColor;
122 } 108 }
123 if (cssValueId == CSSValueMenu) 109 if (cssValueId == CSSValueMenu)
124 return defaultMenuColor; 110 return defaultMenuColor;
125 return RenderTheme::systemColor(cssValueId); 111 return RenderTheme::systemColor(cssValueId);
126 } 112 }
127 113
128 String RenderThemeChromiumDefault::extraDefaultStyleSheet() 114 String RenderThemeChromiumDefault::extraDefaultStyleSheet()
129 { 115 {
130 // FIXME: We should not have OS() branches here. 116 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
131 // We should have something like RenderThemeWin, RenderThemeLinux, or 117 return RenderThemeChromiumSkia::extraDefaultStyleSheet()
132 // should concatenate UA stylesheets on build time. 118 + String(themeInputMultipleFieldsCss, sizeof(themeInputMultipleFieldsCss ));
133 #if !OS(WIN)
134 return RenderThemeChromiumSkia::extraDefaultStyleSheet() +
135 #if !OS(ANDROID)
136 String(themeInputMultipleFieldsCss, sizeof(themeInputMultipleFieldsCss)) +
137 #endif
138 String(themeChromiumLinuxCss, sizeof(themeChromiumLinuxCss));
139 #else 119 #else
140 return RenderThemeChromiumSkia::extraDefaultStyleSheet() + 120 return RenderThemeChromiumSkia::extraDefaultStyleSheet();
141 String(themeInputMultipleFieldsCss, sizeof(themeInputMultipleFieldsCss)) ;
142 #endif 121 #endif
143 } 122 }
144 123
145 Color RenderThemeChromiumDefault::activeListBoxSelectionBackgroundColor() const 124 Color RenderThemeChromiumDefault::activeListBoxSelectionBackgroundColor() const
146 { 125 {
147 return Color(0x28, 0x28, 0x28); 126 return Color(0x28, 0x28, 0x28);
148 } 127 }
149 128
150 Color RenderThemeChromiumDefault::activeListBoxSelectionForegroundColor() const 129 Color RenderThemeChromiumDefault::activeListBoxSelectionForegroundColor() const
151 { 130 {
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 if (useMockTheme()) { 494 if (useMockTheme()) {
516 // The mock theme can't handle zoomed controls, so we fall back to the " fallback" theme. 495 // The mock theme can't handle zoomed controls, so we fall back to the " fallback" theme.
517 ControlPart part = style->appearance(); 496 ControlPart part = style->appearance();
518 if (part == CheckboxPart || part == RadioPart) 497 if (part == CheckboxPart || part == RadioPart)
519 return style->effectiveZoom() != 1; 498 return style->effectiveZoom() != 1;
520 } 499 }
521 return RenderTheme::shouldUseFallbackTheme(style); 500 return RenderTheme::shouldUseFallbackTheme(style);
522 } 501 }
523 502
524 } // namespace blink 503 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderThemeChromiumDefault.h ('k') | Source/core/rendering/RenderThemeChromiumLinux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698