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

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

Issue 10832282: Replace views::MouseEvent with ui::MouseEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/menu_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button.cc
===================================================================
--- ui/views/controls/button/custom_button.cc (revision 151406)
+++ ui/views/controls/button/custom_button.cc (working copy)
@@ -108,7 +108,7 @@
return kViewClassName;
}
-bool CustomButton::OnMousePressed(const MouseEvent& event) {
+bool CustomButton::OnMousePressed(const ui::MouseEvent& event) {
if (state_ != BS_DISABLED) {
if (ShouldEnterPushedState(event) && HitTestPoint(event.location()))
SetState(BS_PUSHED);
@@ -118,7 +118,7 @@
return true;
}
-bool CustomButton::OnMouseDragged(const MouseEvent& event) {
+bool CustomButton::OnMouseDragged(const ui::MouseEvent& event) {
if (state_ != BS_DISABLED) {
if (HitTestPoint(event.location()))
SetState(ShouldEnterPushedState(event) ? BS_PUSHED : BS_HOT);
@@ -128,7 +128,7 @@
return true;
}
-void CustomButton::OnMouseReleased(const MouseEvent& event) {
+void CustomButton::OnMouseReleased(const ui::MouseEvent& event) {
if (state_ == BS_DISABLED)
return;
@@ -151,18 +151,18 @@
SetState(BS_NORMAL);
}
-void CustomButton::OnMouseEntered(const MouseEvent& event) {
+void CustomButton::OnMouseEntered(const ui::MouseEvent& event) {
if (state_ != BS_DISABLED)
SetState(BS_HOT);
}
-void CustomButton::OnMouseExited(const MouseEvent& event) {
+void CustomButton::OnMouseExited(const ui::MouseEvent& event) {
// Starting a drag results in a MouseExited, we need to ignore it.
if (state_ != BS_DISABLED && !InDrag())
SetState(BS_NORMAL);
}
-void CustomButton::OnMouseMoved(const MouseEvent& event) {
+void CustomButton::OnMouseMoved(const ui::MouseEvent& event) {
if (state_ != BS_DISABLED)
SetState(HitTestPoint(event.location()) ? BS_HOT : BS_NORMAL);
}
@@ -179,8 +179,10 @@
} else if (event.key_code() == ui::VKEY_RETURN) {
SetState(BS_NORMAL);
// TODO(beng): remove once NotifyClick takes ui::Event.
- views::MouseEvent synthetic_event(
- ui::ET_MOUSE_RELEASED, 0, 0, ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent synthetic_event(ui::ET_MOUSE_RELEASED,
+ gfx::Point(),
+ gfx::Point(),
+ ui::EF_LEFT_MOUSE_BUTTON);
NotifyClick(synthetic_event);
} else {
return false;
@@ -194,8 +196,10 @@
SetState(BS_NORMAL);
// TODO(beng): remove once NotifyClick takes ui::Event.
- views::MouseEvent synthetic_event(
- ui::ET_MOUSE_RELEASED, 0, 0, ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent synthetic_event(ui::ET_MOUSE_RELEASED,
+ gfx::Point(),
+ gfx::Point(),
+ ui::EF_LEFT_MOUSE_BUTTON);
NotifyClick(synthetic_event);
return true;
}
@@ -231,8 +235,10 @@
accelerator.modifiers());
*/
// TODO(beng): remove once NotifyClick takes ui::Event.
- views::MouseEvent synthetic_event(
- ui::ET_MOUSE_RELEASED, 0, 0, ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent synthetic_event(ui::ET_MOUSE_RELEASED,
+ gfx::Point(),
+ gfx::Point(),
+ ui::EF_LEFT_MOUSE_BUTTON);
NotifyClick(synthetic_event);
return true;
}
« no previous file with comments | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/menu_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698