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

Side by Side Diff: ash/tooltips/tooltip_controller.cc

Issue 10151001: aura: Do not show tooltips if mouse cursor is hidden. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/tooltips/tooltip_controller_unittest.cc » ('j') | 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 "ash/tooltips/tooltip_controller.h" 5 #include "ash/tooltips/tooltip_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 } 366 }
367 *text = result; 367 *text = result;
368 } 368 }
369 369
370 void TooltipController::TooltipTimerFired() { 370 void TooltipController::TooltipTimerFired() {
371 UpdateIfRequired(); 371 UpdateIfRequired();
372 } 372 }
373 373
374 void TooltipController::UpdateIfRequired() { 374 void TooltipController::UpdateIfRequired() {
375 if (!tooltips_enabled_ || mouse_pressed_ || IsDragDropInProgress()) { 375 if (!tooltips_enabled_ || mouse_pressed_ || IsDragDropInProgress() ||
376 !Shell::GetRootWindow()->cursor_shown()) {
376 tooltip_->Hide(); 377 tooltip_->Hide();
377 return; 378 return;
378 } 379 }
379 380
380 string16 tooltip_text; 381 string16 tooltip_text;
381 if (tooltip_window_) 382 if (tooltip_window_)
382 tooltip_text = aura::client::GetTooltipText(tooltip_window_); 383 tooltip_text = aura::client::GetTooltipText(tooltip_window_);
383 384
384 // If the user pressed a mouse button. We will hide the tooltip and not show 385 // If the user pressed a mouse button. We will hide the tooltip and not show
385 // it until there is a change in the tooltip. 386 // it until there is a change in the tooltip.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 bool TooltipController::IsDragDropInProgress() { 419 bool TooltipController::IsDragDropInProgress() {
419 aura::client::DragDropClient* client = aura::client::GetDragDropClient( 420 aura::client::DragDropClient* client = aura::client::GetDragDropClient(
420 Shell::GetRootWindow()); 421 Shell::GetRootWindow());
421 if (client) 422 if (client)
422 return client->IsDragDropInProgress(); 423 return client->IsDragDropInProgress();
423 return false; 424 return false;
424 } 425 }
425 426
426 } // namespace internal 427 } // namespace internal
427 } // namespace ash 428 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/tooltips/tooltip_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698