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

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

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 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
Index: ui/views/controls/button/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 5040c4ea9cf13cf814f091766d2af59e6f9bceb7..648ef20f8e2d0b303eb6372cb493d338ebcc0c9f 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -198,10 +198,11 @@ bool CustomButton::OnKeyPressed(const ui::KeyEvent& event) {
} else if (event.key_code() == ui::VKEY_RETURN) {
SetState(STATE_NORMAL);
// TODO(beng): remove once NotifyClick takes ui::Event.
- ui::MouseEvent synthetic_event(ui::ET_MOUSE_RELEASED, gfx::Point(),
- gfx::Point(), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON,
- ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent synthetic_event(
+ ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(),
+ ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
+ ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
NotifyClick(synthetic_event);
} else {
return false;
@@ -217,7 +218,8 @@ bool CustomButton::OnKeyReleased(const ui::KeyEvent& event) {
// TODO(beng): remove once NotifyClick takes ui::Event.
ui::MouseEvent synthetic_event(
ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
NotifyClick(synthetic_event);
return true;
}
@@ -256,7 +258,8 @@ bool CustomButton::AcceleratorPressed(const ui::Accelerator& accelerator) {
// TODO(beng): remove once NotifyClick takes ui::Event.
ui::MouseEvent synthetic_event(
ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
- ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
NotifyClick(synthetic_event);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698