summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-02 09:30:28 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-02 09:30:28 +0000
commit894f634cee519f550410ee9bd98f76a3bd956736 (patch)
treeff6ea2885aabfb1d9259552db1feccccf3d3996d /views
parentbe79f8514da41f9b5cbcadfcfed768c8a390b401 (diff)
downloadchromium_src-894f634cee519f550410ee9bd98f76a3bd956736.zip
chromium_src-894f634cee519f550410ee9bd98f76a3bd956736.tar.gz
chromium_src-894f634cee519f550410ee9bd98f76a3bd956736.tar.bz2
Labels don't need to respond to mouse clicks and doing so can interfere with button clicks, for example if the label width extends over a button (in some cases invisibly).
BUG=87439 TEST=None. The problem that prompted this has been fixed by Scott, but similar problems might occur in the future so I think it is good to fix the underlying problem as well (since the symptoms are so weird: half a button non-clickable). Review URL: http://codereview.chromium.org/7298009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91421 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/label.cc4
-rw-r--r--views/controls/label.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/views/controls/label.cc b/views/controls/label.cc
index fc392aa..83dd8d6 100644
--- a/views/controls/label.cc
+++ b/views/controls/label.cc
@@ -215,6 +215,10 @@ std::string Label::GetClassName() const {
return kViewClassName;
}
+bool Label::HitTest(const gfx::Point& l) const {
+ return false;
+}
+
void Label::OnMouseMoved(const MouseEvent& event) {
UpdateContainsMouse(event);
}
diff --git a/views/controls/label.h b/views/controls/label.h
index 24944cd..a053e44 100644
--- a/views/controls/label.h
+++ b/views/controls/label.h
@@ -6,6 +6,8 @@
#define VIEWS_CONTROLS_LABEL_H_
#pragma once
+#include <string>
+
#include "base/gtest_prod_util.h"
#include "googleurl/src/gurl.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -163,6 +165,7 @@ class Label : public View {
// Sets the enabled state. Setting the enabled state resets the color.
virtual void OnEnabledChanged() OVERRIDE;
virtual std::string GetClassName() const OVERRIDE;
+ virtual bool HitTest(const gfx::Point& l) const OVERRIDE;
// Mouse enter/exit are overridden to render mouse over background color.
// These invoke SetContainsMouse as necessary.
virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE;