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

Unified Diff: webkit/tools/test_shell/test_shell_webthemecontrol.cc

Issue 1988012: Added support for HTML5 progress element. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: took the feedback Created 10 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 side-by-side diff with in-line comments
Download patch
Index: webkit/tools/test_shell/test_shell_webthemecontrol.cc
diff --git a/webkit/tools/test_shell/test_shell_webthemecontrol.cc b/webkit/tools/test_shell/test_shell_webthemecontrol.cc
index 742a29560acaa2a4f7017c136911c7fc166cda76..96045f3ba8d1f0b87c23cde283b4abec6032df1a 100644
--- a/webkit/tools/test_shell/test_shell_webthemecontrol.cc
+++ b/webkit/tools/test_shell/test_shell_webthemecontrol.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.
@@ -30,7 +30,8 @@ const SkColor kBgColors[] = {
SkColorSetRGB(0x43, 0xf9, 0xff), // Hot
SkColorSetRGB(0x20, 0xf6, 0xcc), // Focused
SkColorSetRGB(0x00, 0xf3, 0xac), // Hover
- SkColorSetRGB(0xa9, 0xff, 0x12) // Pressed
+ SkColorSetRGB(0xa9, 0xff, 0x12), // Pressed
+ SkColorSetRGB(0xcc, 0xcc, 0xcc) // Indeterminate
};
SkIRect Validate(const SkIRect& rect, Control::Type ctype) {
@@ -53,7 +54,7 @@ SkIRect Validate(const SkIRect& rect, Control::Type ctype) {
return retval;
}
-Control::Control(skia::PlatformCanvas *canvas, const SkIRect &irect,
+Control::Control(skia::PlatformCanvas* canvas, const SkIRect& irect,
Type ctype, State cstate)
: canvas_(canvas),
irect_(Validate(irect, ctype)),
@@ -73,7 +74,7 @@ Control::Control(skia::PlatformCanvas *canvas, const SkIRect &irect,
Control::~Control() {
}
-void Control::box(const SkIRect &rect, SkColor fill_color) {
+void Control::box(const SkIRect& rect, SkColor fill_color) {
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
@@ -411,5 +412,25 @@ void Control::drawTextField(bool draw_edges, bool fill_content_area,
canvas_->endPlatformPaint();
}
+void
+Control::drawProgressBar(const SkIRect& fill_rect) {
+ SkPaint paint;
+
+ canvas_->beginPlatformPaint();
+ paint.setColor(bg_color_);
+ paint.setStyle(SkPaint::kFill_Style);
+ canvas_->drawIRect(irect_, paint);
+
+ // Emulate clipping
+ SkIRect tofill;
+ tofill.intersect(irect_, fill_rect);
+ paint.setColor(fg_color_);
+ paint.setStyle(SkPaint::kFill_Style);
+ canvas_->drawIRect(tofill, paint);
+
+ markState();
+ canvas_->endPlatformPaint();
+}
+
} // namespace TestShellWebTheme

Powered by Google App Engine
This is Rietveld 408576698