| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/tooltip_manager_views.h" | 5 #include "views/widget/tooltip_manager_views.h" |
| 6 | 6 |
| 7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
| 13 #include <windowsx.h> | 13 #include <windowsx.h> |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #include "base/event_types.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "base/time.h" | 18 #include "base/time.h" |
| 18 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 19 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
| 20 #if defined(USE_AURA) | 21 #if defined(USE_AURA) |
| 21 #include "ui/aura/aura_constants.h" | 22 #include "ui/aura/aura_constants.h" |
| 22 #include "ui/aura/event.h" | 23 #include "ui/aura/event.h" |
| 23 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
| 24 #endif | 25 #endif |
| 25 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/gfx/font.h" | 27 #include "ui/gfx/font.h" |
| 27 #include "ui/gfx/screen.h" | 28 #include "ui/gfx/screen.h" |
| 28 #include "views/background.h" | 29 #include "views/background.h" |
| 29 #include "views/border.h" | 30 #include "views/border.h" |
| 30 #include "views/events/event.h" | 31 #include "views/events/event.h" |
| 31 #include "views/focus/focus_manager.h" | 32 #include "views/focus/focus_manager.h" |
| 32 #include "views/view.h" | 33 #include "views/view.h" |
| 33 #include "views/widget/native_widget.h" | 34 #include "views/widget/native_widget.h" |
| 34 | 35 |
| 35 #if defined(USE_WAYLAND) | |
| 36 #include "ui/wayland/events/wayland_event.h" | |
| 37 #endif | |
| 38 | |
| 39 namespace { | 36 namespace { |
| 40 SkColor kTooltipBackground = 0xFF7F7F00; | 37 SkColor kTooltipBackground = 0xFF7F7F00; |
| 41 int kTooltipTimeoutMs = 500; | 38 int kTooltipTimeoutMs = 500; |
| 42 | 39 |
| 43 // FIXME: get cursor offset from actual cursor size. | 40 // FIXME: get cursor offset from actual cursor size. |
| 44 int kCursorOffsetX = 10; | 41 int kCursorOffsetX = 10; |
| 45 int kCursorOffsetY = 15; | 42 int kCursorOffsetY = 15; |
| 46 } | 43 } |
| 47 | 44 |
| 48 namespace views { | 45 namespace views { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 if (tooltip_timer_.IsRunning()) | 229 if (tooltip_timer_.IsRunning()) |
| 233 tooltip_timer_.Reset(); | 230 tooltip_timer_.Reset(); |
| 234 curr_mouse_pos_.SetPoint(x, y); | 231 curr_mouse_pos_.SetPoint(x, y); |
| 235 | 232 |
| 236 // If tooltip is visible, we may want to hide it. If it is not, we are ok. | 233 // If tooltip is visible, we may want to hide it. If it is not, we are ok. |
| 237 if (tooltip_widget_->IsVisible()) | 234 if (tooltip_widget_->IsVisible()) |
| 238 UpdateIfRequired(curr_mouse_pos_.x(), curr_mouse_pos_.y(), false); | 235 UpdateIfRequired(curr_mouse_pos_.x(), curr_mouse_pos_.y(), false); |
| 239 } | 236 } |
| 240 | 237 |
| 241 } // namespace views | 238 } // namespace views |
| OLD | NEW |