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

Side by Side Diff: sky/viewer/platform/webthemeengine_impl.cc

Issue 664573003: Fix compile issues in sky on android (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « sky/engine/platform/heap/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sky/viewer/platform/webthemeengine_impl.h" 5 #include "sky/viewer/platform/webthemeengine_impl.h"
6 6
7 #include "skia/ext/platform_canvas.h" 7 #include "skia/ext/platform_canvas.h"
8 #include "sky/engine/public/platform/WebRect.h" 8 #include "sky/engine/public/platform/WebRect.h"
9 #include "sky/engine/public/platform/WebSize.h" 9 #include "sky/engine/public/platform/WebSize.h"
10 #include "ui/native_theme/native_theme.h" 10 #include "ui/native_theme/native_theme.h"
11 11
12 using blink::WebCanvas; 12 using blink::WebCanvas;
13 using blink::WebColor; 13 using blink::WebColor;
14 using blink::WebRect; 14 using blink::WebRect;
15 using blink::WebThemeEngine; 15 using blink::WebThemeEngine;
16 16
17 namespace sky { 17 namespace sky {
18 18
19 #if !defined(OS_ANDROID)
19 static ui::NativeTheme::Part NativeThemePart( 20 static ui::NativeTheme::Part NativeThemePart(
20 WebThemeEngine::Part part) { 21 WebThemeEngine::Part part) {
21 switch (part) { 22 switch (part) {
22 case WebThemeEngine::PartScrollbarDownArrow: 23 case WebThemeEngine::PartScrollbarDownArrow:
23 return ui::NativeTheme::kScrollbarDownArrow; 24 return ui::NativeTheme::kScrollbarDownArrow;
24 case WebThemeEngine::PartScrollbarLeftArrow: 25 case WebThemeEngine::PartScrollbarLeftArrow:
25 return ui::NativeTheme::kScrollbarLeftArrow; 26 return ui::NativeTheme::kScrollbarLeftArrow;
26 case WebThemeEngine::PartScrollbarRightArrow: 27 case WebThemeEngine::PartScrollbarRightArrow:
27 return ui::NativeTheme::kScrollbarRightArrow; 28 return ui::NativeTheme::kScrollbarRightArrow;
28 case WebThemeEngine::PartScrollbarUpArrow: 29 case WebThemeEngine::PartScrollbarUpArrow:
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 case WebThemeEngine::StateHover: 69 case WebThemeEngine::StateHover:
69 return ui::NativeTheme::kHovered; 70 return ui::NativeTheme::kHovered;
70 case WebThemeEngine::StateNormal: 71 case WebThemeEngine::StateNormal:
71 return ui::NativeTheme::kNormal; 72 return ui::NativeTheme::kNormal;
72 case WebThemeEngine::StatePressed: 73 case WebThemeEngine::StatePressed:
73 return ui::NativeTheme::kPressed; 74 return ui::NativeTheme::kPressed;
74 default: 75 default:
75 return ui::NativeTheme::kDisabled; 76 return ui::NativeTheme::kDisabled;
76 } 77 }
77 } 78 }
79 #endif
78 80
79 static void GetNativeThemeExtraParams( 81 static void GetNativeThemeExtraParams(
80 WebThemeEngine::Part part, 82 WebThemeEngine::Part part,
81 WebThemeEngine::State state, 83 WebThemeEngine::State state,
82 const WebThemeEngine::ExtraParams* extra_params, 84 const WebThemeEngine::ExtraParams* extra_params,
83 ui::NativeTheme::ExtraParams* native_theme_extra_params) { 85 ui::NativeTheme::ExtraParams* native_theme_extra_params) {
84 switch (part) { 86 switch (part) {
85 case WebThemeEngine::PartScrollbarHorizontalTrack: 87 case WebThemeEngine::PartScrollbarHorizontalTrack:
86 case WebThemeEngine::PartScrollbarVerticalTrack: 88 case WebThemeEngine::PartScrollbarVerticalTrack:
87 native_theme_extra_params->scrollbar_track.track_x = 89 native_theme_extra_params->scrollbar_track.track_x =
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 extra_params->progressBar.valueRectWidth; 156 extra_params->progressBar.valueRectWidth;
155 native_theme_extra_params->progress_bar.value_rect_height = 157 native_theme_extra_params->progress_bar.value_rect_height =
156 extra_params->progressBar.valueRectHeight; 158 extra_params->progressBar.valueRectHeight;
157 break; 159 break;
158 default: 160 default:
159 break; // Parts that have no extra params get here. 161 break; // Parts that have no extra params get here.
160 } 162 }
161 } 163 }
162 164
163 blink::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) { 165 blink::WebSize WebThemeEngineImpl::getSize(WebThemeEngine::Part part) {
166 #if defined(OS_ANDROID)
167 return blink::WebSize();
168 #else
164 ui::NativeTheme::ExtraParams extra; 169 ui::NativeTheme::ExtraParams extra;
165 return ui::NativeTheme::instance()->GetPartSize(NativeThemePart(part), 170 return ui::NativeTheme::instance()->GetPartSize(NativeThemePart(part),
166 ui::NativeTheme::kNormal, 171 ui::NativeTheme::kNormal,
167 extra); 172 extra);
173 #endif
168 } 174 }
169 175
170 void WebThemeEngineImpl::paint( 176 void WebThemeEngineImpl::paint(
171 blink::WebCanvas* canvas, 177 blink::WebCanvas* canvas,
172 WebThemeEngine::Part part, 178 WebThemeEngine::Part part,
173 WebThemeEngine::State state, 179 WebThemeEngine::State state,
174 const blink::WebRect& rect, 180 const blink::WebRect& rect,
175 const WebThemeEngine::ExtraParams* extra_params) { 181 const WebThemeEngine::ExtraParams* extra_params) {
176 ui::NativeTheme::ExtraParams native_theme_extra_params; 182 ui::NativeTheme::ExtraParams native_theme_extra_params;
177 GetNativeThemeExtraParams( 183 GetNativeThemeExtraParams(
178 part, state, extra_params, &native_theme_extra_params); 184 part, state, extra_params, &native_theme_extra_params);
185 #if !defined(OS_ANDROID)
179 ui::NativeTheme::instance()->Paint( 186 ui::NativeTheme::instance()->Paint(
180 canvas, 187 canvas,
181 NativeThemePart(part), 188 NativeThemePart(part),
182 NativeThemeState(state), 189 NativeThemeState(state),
183 gfx::Rect(rect), 190 gfx::Rect(rect),
184 native_theme_extra_params); 191 native_theme_extra_params);
192 #endif
185 } 193 }
186 194
187 void WebThemeEngineImpl::paintStateTransition(blink::WebCanvas* canvas, 195 void WebThemeEngineImpl::paintStateTransition(blink::WebCanvas* canvas,
188 WebThemeEngine::Part part, 196 WebThemeEngine::Part part,
189 WebThemeEngine::State startState, 197 WebThemeEngine::State startState,
190 WebThemeEngine::State endState, 198 WebThemeEngine::State endState,
191 double progress, 199 double progress,
192 const blink::WebRect& rect) { 200 const blink::WebRect& rect) {
201 #if !defined(OS_ANDROID)
193 ui::NativeTheme::instance()->PaintStateTransition( 202 ui::NativeTheme::instance()->PaintStateTransition(
194 canvas, 203 canvas,
195 NativeThemePart(part), 204 NativeThemePart(part),
196 NativeThemeState(startState), 205 NativeThemeState(startState),
197 NativeThemeState(endState), 206 NativeThemeState(endState),
198 progress, 207 progress,
199 gfx::Rect(rect)); 208 gfx::Rect(rect));
209 #endif
200 } 210 }
201 211
202 } // namespace sky 212 } // namespace sky
OLDNEW
« no previous file with comments | « sky/engine/platform/heap/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698