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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 GetTooltip()->Hide(); | 426 GetTooltip()->Hide(); |
427 | 427 |
428 // Since the user presumably no longer needs the tooltip, we also stop the | 428 // Since the user presumably no longer needs the tooltip, we also stop the |
429 // tooltip timer so that tooltip does not pop back up. We will restart this | 429 // tooltip timer so that tooltip does not pop back up. We will restart this |
430 // timer if the tooltip changes (see UpdateTooltip()). | 430 // timer if the tooltip changes (see UpdateTooltip()). |
431 tooltip_timer_.Stop(); | 431 tooltip_timer_.Stop(); |
432 } | 432 } |
433 | 433 |
434 void TooltipController::UpdateIfRequired() { | 434 void TooltipController::UpdateIfRequired() { |
435 if (!tooltips_enabled_ || mouse_pressed_ || IsDragDropInProgress() || | 435 if (!tooltips_enabled_ || mouse_pressed_ || IsDragDropInProgress() || |
436 !ash::Shell::GetInstance()->cursor_manager()->cursor_visible()) { | 436 !ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible()) { |
437 GetTooltip()->Hide(); | 437 GetTooltip()->Hide(); |
438 return; | 438 return; |
439 } | 439 } |
440 | 440 |
441 string16 tooltip_text; | 441 string16 tooltip_text; |
442 if (tooltip_window_) | 442 if (tooltip_window_) |
443 tooltip_text = aura::client::GetTooltipText(tooltip_window_); | 443 tooltip_text = aura::client::GetTooltipText(tooltip_window_); |
444 | 444 |
445 // If the user pressed a mouse button. We will hide the tooltip and not show | 445 // If the user pressed a mouse button. We will hide the tooltip and not show |
446 // it until there is a change in the tooltip. | 446 // it until there is a change in the tooltip. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 } | 485 } |
486 | 486 |
487 TooltipController::Tooltip* TooltipController::GetTooltip() { | 487 TooltipController::Tooltip* TooltipController::GetTooltip() { |
488 if (!tooltip_.get()) | 488 if (!tooltip_.get()) |
489 tooltip_.reset(new Tooltip(this)); | 489 tooltip_.reset(new Tooltip(this)); |
490 return tooltip_.get(); | 490 return tooltip_.get(); |
491 } | 491 } |
492 | 492 |
493 } // namespace internal | 493 } // namespace internal |
494 } // namespace ash | 494 } // namespace ash |
OLD | NEW |