diff options
Diffstat (limited to 'webkit/tools/test_shell/test_shell_webthemecontrol.cc')
-rw-r--r-- | webkit/tools/test_shell/test_shell_webthemecontrol.cc | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/webkit/tools/test_shell/test_shell_webthemecontrol.cc b/webkit/tools/test_shell/test_shell_webthemecontrol.cc index 742a295..96045f3 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 |