summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authortkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 05:01:00 +0000
committertkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 05:01:00 +0000
commit0a5275736f8d41119fcfe3298997eed39ee37f15 (patch)
tree5f0c6c4fb93a9fa7edba16c2aa9907f246dcf55b /webkit
parent9936e688c8acb10691a081a21142e3f802f5225d (diff)
downloadchromium_src-0a5275736f8d41119fcfe3298997eed39ee37f15.zip
chromium_src-0a5275736f8d41119fcfe3298997eed39ee37f15.tar.gz
chromium_src-0a5275736f8d41119fcfe3298997eed39ee37f15.tar.bz2
Implement indeterminate checkbox for the generic theme.
BUG=36321,48154 TEST=This is a part of test code. Review URL: http://codereview.chromium.org/2876036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/tools/test_shell/test_shell_webthemecontrol.cc5
-rw-r--r--webkit/tools/test_shell/test_shell_webthemecontrol.h1
-rw-r--r--webkit/tools/test_shell/test_shell_webthemeengine.cc22
3 files changed, 28 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/test_shell_webthemecontrol.cc b/webkit/tools/test_shell/test_shell_webthemecontrol.cc
index 96045f3..08a5a56 100644
--- a/webkit/tools/test_shell/test_shell_webthemecontrol.cc
+++ b/webkit/tools/test_shell/test_shell_webthemecontrol.cc
@@ -267,6 +267,11 @@ void Control::draw() {
nested_boxes(kCheckIndent, kCheckIndent, kCheckIndent, kCheckIndent,
bg_color_, fg_color_);
break;
+ case kIndeterminateCheckBox_Type:
+ // Indeterminate checkbox is a box containing '-'.
+ nested_boxes(kCheckIndent, height_ / 2, kCheckIndent, height_ / 2,
+ bg_color_, fg_color_);
+ break;
case kUncheckedRadio_Type:
circle(SkIntToScalar(half_height), bg_color_);
break;
diff --git a/webkit/tools/test_shell/test_shell_webthemecontrol.h b/webkit/tools/test_shell/test_shell_webthemecontrol.h
index ddb8633..3b949b4 100644
--- a/webkit/tools/test_shell/test_shell_webthemecontrol.h
+++ b/webkit/tools/test_shell/test_shell_webthemecontrol.h
@@ -72,6 +72,7 @@ class Control {
kPushButton_Type,
kUncheckedBox_Type,
kCheckedBox_Type,
+ kIndeterminateCheckBox_Type,
kUncheckedRadio_Type,
kCheckedRadio_Type,
kHorizontalScrollTrackBack_Type,
diff --git a/webkit/tools/test_shell/test_shell_webthemeengine.cc b/webkit/tools/test_shell/test_shell_webthemeengine.cc
index fe6ab05..721af75 100644
--- a/webkit/tools/test_shell/test_shell_webthemeengine.cc
+++ b/webkit/tools/test_shell/test_shell_webthemeengine.cc
@@ -111,6 +111,28 @@ void Engine::paintButton(WebCanvas* canvas, int part, int state,
ctype = Control::kCheckedBox_Type;
cstate = Control::kDisabled_State;
break;
+ case CBS_MIXEDNORMAL:
+ // Classic theme can't represent mixed state checkbox. We assume
+ // it's equivalent to unchecked.
+ CHECK_EQ(classic_state, DFCS_BUTTONCHECK);
+ ctype = Control::kIndeterminateCheckBox_Type;
+ cstate = Control::kNormal_State;
+ break;
+ case CBS_MIXEDHOT:
+ CHECK_EQ(classic_state, DFCS_BUTTONCHECK | DFCS_HOT);
+ ctype = Control::kIndeterminateCheckBox_Type;
+ cstate = Control::kHot_State;
+ break;
+ case CBS_MIXEDPRESSED:
+ CHECK_EQ(classic_state, DFCS_BUTTONCHECK | DFCS_PUSHED);
+ ctype = Control::kIndeterminateCheckBox_Type;
+ cstate = Control::kPressed_State;
+ break;
+ case CBS_MIXEDDISABLED:
+ CHECK_EQ(classic_state, DFCS_BUTTONCHECK | DFCS_INACTIVE);
+ ctype = Control::kIndeterminateCheckBox_Type;
+ cstate = Control::kDisabled_State;
+ break;
default:
NOTREACHED();
break;