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

Unified Diff: ui/views/corewm/tooltip_controller.cc

Issue 2829653002: Removed (spurious, touch-initiated) tooltips from nav buttons (Closed)
Patch Set: Created 3 years, 8 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/corewm/tooltip_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/tooltip_controller.cc
diff --git a/ui/views/corewm/tooltip_controller.cc b/ui/views/corewm/tooltip_controller.cc
index bd400e9c30e4c31730872009c9b795c12dbd7331..bb4ea500c0a8613ff27fa7a8c6dfb09bd9e0b0bb 100644
--- a/ui/views/corewm/tooltip_controller.cc
+++ b/ui/views/corewm/tooltip_controller.cc
@@ -181,6 +181,16 @@ void TooltipController::OnKeyEvent(ui::KeyEvent* event) {
}
void TooltipController::OnMouseEvent(ui::MouseEvent* event) {
+ // Ignore mouse events that coincide with the last touch event.
+ if (event->location() == last_touch_loc_) {
+ SetTooltipWindow(NULL);
sadrul 2017/04/19 18:31:16 nullptr
girard 2017/04/19 21:39:40 Acknowledged.
+
+ if (tooltip_->IsVisible() ||
+ (tooltip_window_ &&
sadrul 2017/04/19 18:31:16 Because you are calling SetTooltipWindow(nullptr)
girard 2017/04/19 21:39:40 Acknowledged.
+ tooltip_text_ != aura::client::GetTooltipText(tooltip_window_)))
+ UpdateIfRequired();
+ return;
+ }
switch (event->type()) {
case ui::ET_MOUSE_CAPTURE_CHANGED:
case ui::ET_MOUSE_EXITED:
@@ -224,11 +234,10 @@ void TooltipController::OnMouseEvent(ui::MouseEvent* event) {
}
void TooltipController::OnTouchEvent(ui::TouchEvent* event) {
- // TODO(varunjain): need to properly implement tooltips for
- // touch events.
// Hide the tooltip for touch events.
tooltip_->Hide();
SetTooltipWindow(NULL);
+ last_touch_loc_ = event->location();
}
void TooltipController::OnCancelMode(ui::CancelModeEvent* event) {
« no previous file with comments | « ui/views/corewm/tooltip_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698