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

Side by Side Diff: ui/views/corewm/tooltip_controller.cc

Issue 274753002: Ignores mouse motion events when mouse is pressed or drag and drop is in progress (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ignore mouse motion events when mouse is pressed or drag and drop is in progress Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/corewm/tooltip_controller.h" 5 #include "ui/views/corewm/tooltip_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 TooltipShownTimerFired(); 178 TooltipShownTimerFired();
179 } 179 }
180 } 180 }
181 181
182 void TooltipController::OnMouseEvent(ui::MouseEvent* event) { 182 void TooltipController::OnMouseEvent(ui::MouseEvent* event) {
183 switch (event->type()) { 183 switch (event->type()) {
184 case ui::ET_MOUSE_CAPTURE_CHANGED: 184 case ui::ET_MOUSE_CAPTURE_CHANGED:
185 case ui::ET_MOUSE_EXITED: 185 case ui::ET_MOUSE_EXITED:
186 case ui::ET_MOUSE_MOVED: 186 case ui::ET_MOUSE_MOVED:
187 case ui::ET_MOUSE_DRAGGED: { 187 case ui::ET_MOUSE_DRAGGED: {
188 if (!tooltips_enabled_ ||
sky 2014/05/20 20:43:22 I think this early out is too early. You still wan
varkha 2014/05/20 21:12:26 You are right - for the capture changes and mouse
189 aura::Env::GetInstance()->IsMouseButtonDown() ||
190 IsDragDropInProgress()) {
191 break;
192 }
193
188 curr_mouse_loc_ = event->location(); 194 curr_mouse_loc_ = event->location();
189 aura::Window* target = GetTooltipTarget(*event, &curr_mouse_loc_); 195 aura::Window* target = GetTooltipTarget(*event, &curr_mouse_loc_);
190 SetTooltipWindow(target); 196 SetTooltipWindow(target);
191 if (tooltip_timer_.IsRunning()) 197 if (tooltip_timer_.IsRunning())
192 tooltip_timer_.Reset(); 198 tooltip_timer_.Reset();
193 199
194 if (tooltip_->IsVisible()) 200 if (tooltip_->IsVisible())
195 UpdateIfRequired(); 201 UpdateIfRequired();
196 break; 202 break;
197 } 203 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 return; 350 return;
345 if (tooltip_window_) 351 if (tooltip_window_)
346 tooltip_window_->RemoveObserver(this); 352 tooltip_window_->RemoveObserver(this);
347 tooltip_window_ = target; 353 tooltip_window_ = target;
348 if (tooltip_window_) 354 if (tooltip_window_)
349 tooltip_window_->AddObserver(this); 355 tooltip_window_->AddObserver(this);
350 } 356 }
351 357
352 } // namespace corewm 358 } // namespace corewm
353 } // namespace views 359 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698