| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |