Index: webkit/tools/test_shell/test_shell_webthemeengine.cc |
diff --git a/webkit/tools/test_shell/test_shell_webthemeengine.cc b/webkit/tools/test_shell/test_shell_webthemeengine.cc |
index b9e0308c3eb0b812277cc689bbf8db654d7fb488..8c457a820f32637227a24eb4d1d5d335bf14d676 100644 |
--- a/webkit/tools/test_shell/test_shell_webthemeengine.cc |
+++ b/webkit/tools/test_shell/test_shell_webthemeengine.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -40,26 +40,33 @@ using WebKit::WebRect; |
namespace TestShellWebTheme { |
-SkIRect webRectToSkIRect(const WebRect &web_rect) { |
+SkIRect webRectToSkIRect(const WebRect& web_rect) { |
SkIRect irect; |
irect.set(web_rect.x, web_rect.y, web_rect.x + web_rect.width, |
web_rect.y + web_rect.height); |
return irect; |
} |
-void drawControl(WebCanvas *canvas, const WebRect &rect, Control::Type ctype, |
+void drawControl(WebCanvas* canvas, const WebRect& rect, Control::Type ctype, |
Control::State cstate) { |
Control control(canvas, webRectToSkIRect(rect), ctype, cstate); |
control.draw(); |
} |
-void drawTextField(WebCanvas *canvas, const WebRect &rect, |
+void drawTextField(WebCanvas* canvas, const WebRect& rect, |
Control::Type ctype, Control::State cstate, |
bool draw_edges, bool fill_content_area, WebColor color) { |
Control control(canvas, webRectToSkIRect(rect), ctype, cstate); |
control.drawTextField(draw_edges, fill_content_area, color); |
} |
+void drawProgressBar(WebCanvas* canvas, |
+ Control::Type ctype, Control::State cstate, |
+ const WebRect& bar_rect, const WebRect& fill_rect) { |
+ Control control(canvas, webRectToSkIRect(bar_rect), ctype, cstate); |
+ control.drawProgressBar(webRectToSkIRect(fill_rect)); |
+} |
+ |
void Engine::paintButton(WebCanvas* canvas, int part, int state, |
int classic_state, const WebRect& rect) { |
Control::Type ctype = Control::kUnknown_Type; |
@@ -533,4 +540,14 @@ void Engine::paintTrackbar(WebCanvas* canvas, int part, int state, |
drawControl(canvas, rect, ctype, cstate); |
} |
+ |
+void Engine::paintProgressBar(WebKit::WebCanvas* canvas, |
+ const WebKit::WebRect& barRect, |
+ int valuePart, const WebKit::WebRect& valueRect) { |
+ Control::Type ctype = Control::kProgressBar_Type; |
+ Control::State cstate = valuePart == PP_FILL ? |
+ Control::kNormal_State : Control::kIndeterminate_State; |
+ drawProgressBar(canvas, ctype, cstate, barRect, valueRect); |
+} |
+ |
} // namespace TestShellWebTheme |