Chromium Code Reviews| 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) { |