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

Unified Diff: views/controls/button/custom_button.cc

Issue 194037: Fix hottracking on button views... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Rebased Created 11 years, 3 months 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 | « views/controls/button/custom_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/custom_button.cc
diff --git a/views/controls/button/custom_button.cc b/views/controls/button/custom_button.cc
index f9a58f639d20e2d0171d82055d4dd3395121ceee..c7eadca156c5a1ca93dc58c94f5a656eee7b2751 100644
--- a/views/controls/button/custom_button.cc
+++ b/views/controls/button/custom_button.cc
@@ -219,6 +219,20 @@ void CustomButton::ViewHierarchyChanged(bool is_add, View *parent,
SetState(BS_NORMAL);
}
+void CustomButton::SetHotTracked(bool flag) {
+ if (state_ != BS_DISABLED)
+ SetState(flag ? BS_HOT : BS_NORMAL);
+}
+
+bool CustomButton::IsHotTracked() const {
+ return state_ == BS_HOT;
+}
+
+void CustomButton::WillLoseFocus() {
+ if (IsHotTracked())
+ SetState(BS_NORMAL);
+}
+
////////////////////////////////////////////////////////////////////////////////
// CustomButton, AnimationDelegate implementation:
« no previous file with comments | « views/controls/button/custom_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698