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" |
| 11 #include "ash/wm/cursor_manager.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/location.h" | 13 #include "base/location.h" |
13 #include "base/string_split.h" | 14 #include "base/string_split.h" |
14 #include "base/time.h" | 15 #include "base/time.h" |
15 #include "ui/aura/client/drag_drop_client.h" | 16 #include "ui/aura/client/drag_drop_client.h" |
16 #include "ui/aura/cursor_manager.h" | |
17 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
18 #include "ui/aura/event.h" | 18 #include "ui/aura/event.h" |
19 #include "ui/aura/root_window.h" | 19 #include "ui/aura/root_window.h" |
20 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
22 #include "ui/base/text/text_elider.h" | 22 #include "ui/base/text/text_elider.h" |
23 #include "ui/gfx/font.h" | 23 #include "ui/gfx/font.h" |
24 #include "ui/gfx/point.h" | 24 #include "ui/gfx/point.h" |
25 #include "ui/gfx/rect.h" | 25 #include "ui/gfx/rect.h" |
26 #include "ui/gfx/screen.h" | 26 #include "ui/gfx/screen.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 369 } |
370 *text = result; | 370 *text = result; |
371 } | 371 } |
372 | 372 |
373 void TooltipController::TooltipTimerFired() { | 373 void TooltipController::TooltipTimerFired() { |
374 UpdateIfRequired(); | 374 UpdateIfRequired(); |
375 } | 375 } |
376 | 376 |
377 void TooltipController::UpdateIfRequired() { | 377 void TooltipController::UpdateIfRequired() { |
378 if (!tooltips_enabled_ || mouse_pressed_ || IsDragDropInProgress() || | 378 if (!tooltips_enabled_ || mouse_pressed_ || IsDragDropInProgress() || |
379 !aura::Env::GetInstance()->cursor_manager()->cursor_visible()) { | 379 !ash::Shell::GetInstance()->cursor_manager()->cursor_visible()) { |
380 tooltip_->Hide(); | 380 tooltip_->Hide(); |
381 return; | 381 return; |
382 } | 382 } |
383 | 383 |
384 string16 tooltip_text; | 384 string16 tooltip_text; |
385 if (tooltip_window_) | 385 if (tooltip_window_) |
386 tooltip_text = aura::client::GetTooltipText(tooltip_window_); | 386 tooltip_text = aura::client::GetTooltipText(tooltip_window_); |
387 | 387 |
388 // If the user pressed a mouse button. We will hide the tooltip and not show | 388 // If the user pressed a mouse button. We will hide the tooltip and not show |
389 // it until there is a change in the tooltip. | 389 // it until there is a change in the tooltip. |
(...skipping 29 matching lines...) Expand all Loading... |
419 bool TooltipController::IsTooltipVisible() { | 419 bool TooltipController::IsTooltipVisible() { |
420 return tooltip_->IsVisible(); | 420 return tooltip_->IsVisible(); |
421 } | 421 } |
422 | 422 |
423 bool TooltipController::IsDragDropInProgress() { | 423 bool TooltipController::IsDragDropInProgress() { |
424 return drag_drop_client_->IsDragDropInProgress(); | 424 return drag_drop_client_->IsDragDropInProgress(); |
425 } | 425 } |
426 | 426 |
427 } // namespace internal | 427 } // namespace internal |
428 } // namespace ash | 428 } // namespace ash |
OLD | NEW |