Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: views/widget/tooltip_manager_views.cc

Issue 8378005: wayland: define base:NativeEvent for Wayland (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Create a new wayland namespace in base and define WaylandEvent there. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« views/widget/native_widget_wayland.h ('K') | « views/widget/tooltip_manager_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698