summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 22:33:48 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 22:33:48 +0000
commit5aaf1c1222c440c9c5a3b79c39ceda881660e914 (patch)
tree68f6b073216d8e91a9a1d8fc782b83d72e66d081 /views
parent4cbad9bf84684eda82c9d55b82db113496c7fb9f (diff)
downloadchromium_src-5aaf1c1222c440c9c5a3b79c39ceda881660e914.zip
chromium_src-5aaf1c1222c440c9c5a3b79c39ceda881660e914.tar.gz
chromium_src-5aaf1c1222c440c9c5a3b79c39ceda881660e914.tar.bz2
Disable lables for disabled checkboxes. Original patch by Philippe Beaudoin (see http://codereview.chromium.org/567026 ), r=ben,me.
BUG=22982 TEST=Go to Options->Personal Stuff->Import data from another browser...->From "Google Toolbar". Labels for disabled checkboxes should also look disabled. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38523 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/button/checkbox.cc12
-rw-r--r--views/controls/button/checkbox.h7
2 files changed, 13 insertions, 6 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc
index cba0aaf..f4594be 100644
--- a/views/controls/button/checkbox.cc
+++ b/views/controls/button/checkbox.cc
@@ -1,6 +1,6 @@
-// Copyright (c) 2009 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.
+// 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.
#include "views/controls/button/checkbox.h"
@@ -96,6 +96,12 @@ void Checkbox::Layout() {
native_wrapper_->GetView()->Layout();
}
+void Checkbox::SetEnabled(bool enabled) {
+ NativeButton::SetEnabled(enabled);
+ if (label_)
+ label_->SetEnabled(enabled);
+}
+
void Checkbox::PaintFocusBorder(gfx::Canvas* canvas) {
// Our focus border is rendered by the label, so we don't do anything here.
}
diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h
index e138885..8274070 100644
--- a/views/controls/button/checkbox.h
+++ b/views/controls/button/checkbox.h
@@ -1,6 +1,6 @@
-// Copyright (c) 2009 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.
+// 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.
#ifndef VIEWS_CONTROLS_BUTTON_CHECKBOX_H_
#define VIEWS_CONTROLS_BUTTON_CHECKBOX_H_
@@ -41,6 +41,7 @@ class Checkbox : public NativeButton {
// Overridden from View:
virtual gfx::Size GetPreferredSize();
virtual void Layout();
+ virtual void SetEnabled(bool enabled);
virtual void PaintFocusBorder(gfx::Canvas* canvas);
virtual View* GetViewForPoint(const gfx::Point& point);
virtual View* GetViewForPoint(const gfx::Point& point,