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

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

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, fix tests, cleanup, etc. Created 9 years, 9 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/checkbox.h ('k') | views/controls/button/custom_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/checkbox.cc
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc
index 693e282390110d01600087e55fa5a165ad6be465..0cb01f6f327c9194b3302a04b7f3a7204e9f288c 100644
--- a/views/controls/button/checkbox.cc
+++ b/views/controls/button/checkbox.cc
@@ -131,14 +131,18 @@ bool Checkbox::OnMouseDragged(const MouseEvent& event) {
return false;
}
-void Checkbox::OnMouseReleased(const MouseEvent& event, bool canceled) {
- native_wrapper_->SetPushed(false);
- if (!canceled && HitTestLabel(event)) {
+void Checkbox::OnMouseReleased(const MouseEvent& event) {
+ OnMouseCaptureLost();
+ if (HitTestLabel(event)) {
SetChecked(!checked());
ButtonPressed();
}
}
+void Checkbox::OnMouseCaptureLost() {
+ native_wrapper_->SetPushed(false);
+}
+
void Checkbox::OnMouseMoved(const MouseEvent& event) {
native_wrapper_->SetPushed(HitTestLabel(event));
}
« no previous file with comments | « views/controls/button/checkbox.h ('k') | views/controls/button/custom_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698