| 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 "ui/views/corewm/tooltip_controller.h" | 5 #include "ui/views/corewm/tooltip_controller.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "ui/aura/client/capture_client.h" | 15 #include "ui/aura/client/capture_client.h" |
| 16 #include "ui/aura/client/cursor_client.h" | 16 #include "ui/aura/client/cursor_client.h" |
| 17 #include "ui/aura/client/drag_drop_client.h" |
| 17 #include "ui/aura/client/screen_position_client.h" | 18 #include "ui/aura/client/screen_position_client.h" |
| 18 #include "ui/aura/env.h" | 19 #include "ui/aura/env.h" |
| 19 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
| 20 #include "ui/display/screen.h" | 21 #include "ui/display/screen.h" |
| 21 #include "ui/events/event.h" | 22 #include "ui/events/event.h" |
| 22 #include "ui/gfx/font.h" | 23 #include "ui/gfx/font.h" |
| 23 #include "ui/gfx/geometry/rect.h" | 24 #include "ui/gfx/geometry/rect.h" |
| 24 #include "ui/gfx/text_elider.h" | 25 #include "ui/gfx/text_elider.h" |
| 25 #include "ui/views/corewm/tooltip.h" | 26 #include "ui/views/corewm/tooltip.h" |
| 26 #include "ui/views/widget/tooltip_manager.h" | 27 #include "ui/views/widget/tooltip_manager.h" |
| 27 #include "ui/wm/public/drag_drop_client.h" | |
| 28 | 28 |
| 29 namespace views { | 29 namespace views { |
| 30 namespace corewm { | 30 namespace corewm { |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 const int kTooltipTimeoutMs = 500; | 33 const int kTooltipTimeoutMs = 500; |
| 34 const int kDefaultTooltipShownTimeoutMs = 10000; | 34 const int kDefaultTooltipShownTimeoutMs = 10000; |
| 35 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
| 36 // Drawing a long word in tooltip is very slow on Windows. crbug.com/513693 | 36 // Drawing a long word in tooltip is very slow on Windows. crbug.com/513693 |
| 37 const size_t kMaxTooltipLength = 1024; | 37 const size_t kMaxTooltipLength = 1024; |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 return; | 378 return; |
| 379 if (tooltip_window_) | 379 if (tooltip_window_) |
| 380 tooltip_window_->RemoveObserver(this); | 380 tooltip_window_->RemoveObserver(this); |
| 381 tooltip_window_ = target; | 381 tooltip_window_ = target; |
| 382 if (tooltip_window_) | 382 if (tooltip_window_) |
| 383 tooltip_window_->AddObserver(this); | 383 tooltip_window_->AddObserver(this); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace corewm | 386 } // namespace corewm |
| 387 } // namespace views | 387 } // namespace views |
| OLD | NEW |