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

Unified Diff: ui/views/controls/link.cc

Issue 8909002: views: Convert IsEnabled() to just enabled() since it's just a simple accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
« no previous file with comments | « ui/views/controls/label.cc ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/link.cc
diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc
index 16da0c3b5f4ddf7bed56022d49d69c2158c88660..1ca4b87a4bd66e934be1ea29b44b54fcdffcf99d 100644
--- a/ui/views/controls/link.cc
+++ b/ui/views/controls/link.cc
@@ -52,7 +52,7 @@ std::string Link::GetClassName() const {
}
gfx::NativeCursor Link::GetCursor(const MouseEvent& event) {
- if (!IsEnabled())
+ if (!enabled())
return gfx::kNullCursor;
#if defined(USE_AURA)
return aura::kCursorHand;
@@ -71,7 +71,7 @@ bool Link::HitTest(const gfx::Point& l) const {
}
bool Link::OnMousePressed(const MouseEvent& event) {
- if (!IsEnabled() ||
+ if (!enabled() ||
(!event.IsLeftMouseButton() && !event.IsMiddleMouseButton()))
return false;
SetPressed(true);
@@ -79,7 +79,7 @@ bool Link::OnMousePressed(const MouseEvent& event) {
}
bool Link::OnMouseDragged(const MouseEvent& event) {
- SetPressed(IsEnabled() &&
+ SetPressed(enabled() &&
(event.IsLeftMouseButton() || event.IsMiddleMouseButton()) &&
HitTest(event.location()));
return true;
@@ -89,7 +89,7 @@ void Link::OnMouseReleased(const MouseEvent& event) {
// Change the highlight first just in case this instance is deleted
// while calling the controller
OnMouseCaptureLost();
- if (IsEnabled() &&
+ if (enabled() &&
(event.IsLeftMouseButton() || event.IsMiddleMouseButton()) &&
HitTest(event.location())) {
// Focus the link on click.
@@ -190,8 +190,8 @@ void Link::SetPressed(bool pressed) {
void Link::RecalculateFont() {
// The font should be underlined iff the link is enabled.
- if (IsEnabled() == !(font().GetStyle() & gfx::Font::UNDERLINED)) {
- Label::SetFont(font().DeriveFont(0, IsEnabled() ?
+ if (enabled() == !(font().GetStyle() & gfx::Font::UNDERLINED)) {
+ Label::SetFont(font().DeriveFont(0, enabled() ?
(font().GetStyle() | gfx::Font::UNDERLINED) :
(font().GetStyle() & ~gfx::Font::UNDERLINED)));
}
« no previous file with comments | « ui/views/controls/label.cc ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698