OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/touch/touch_hud_debug.h" | 5 #include "ash/touch/touch_hud_debug.h" |
6 | 6 |
7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "third_party/skia/include/core/SkPath.h" | 14 #include "third_party/skia/include/core/SkPath.h" |
15 #include "ui/aura/window_event_dispatcher.h" | 15 #include "ui/aura/window_event_dispatcher.h" |
16 #include "ui/events/event.h" | 16 #include "ui/events/event.h" |
17 #include "ui/gfx/animation/animation_delegate.h" | 17 #include "ui/gfx/animation/animation_delegate.h" |
18 #include "ui/gfx/canvas.h" | 18 #include "ui/gfx/canvas.h" |
19 #include "ui/gfx/display.h" | 19 #include "ui/gfx/display.h" |
20 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
21 #include "ui/gfx/transform.h" | 21 #include "ui/gfx/transform.h" |
22 #include "ui/views/controls/label.h" | 22 #include "ui/views/controls/label.h" |
23 #include "ui/views/layout/box_layout.h" | 23 #include "ui/views/layout/box_layout.h" |
24 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
25 | 25 |
26 #if defined(USE_X11) | 26 #if defined(USE_X11) |
27 #include <X11/extensions/XInput2.h> | 27 #include <X11/extensions/XInput2.h> |
28 #include <X11/Xlib.h> | 28 #include <X11/Xlib.h> |
29 | 29 |
30 #include "ui/events/x/device_data_manager.h" | 30 #include "ui/events/x/device_data_manager_x11.h" |
31 #endif | 31 #endif |
32 | 32 |
33 namespace ash { | 33 namespace ash { |
34 | 34 |
35 const int kPointRadius = 20; | 35 const int kPointRadius = 20; |
36 const SkColor kColors[] = { | 36 const SkColor kColors[] = { |
37 SK_ColorYELLOW, | 37 SK_ColorYELLOW, |
38 SK_ColorGREEN, | 38 SK_ColorGREEN, |
39 SK_ColorRED, | 39 SK_ColorRED, |
40 SK_ColorBLUE, | 40 SK_ColorBLUE, |
(...skipping 25 matching lines...) Expand all Loading... |
66 default: | 66 default: |
67 break; | 67 break; |
68 } | 68 } |
69 return "?"; | 69 return "?"; |
70 } | 70 } |
71 | 71 |
72 int GetTrackingId(const ui::TouchEvent& event) { | 72 int GetTrackingId(const ui::TouchEvent& event) { |
73 if (!event.HasNativeEvent()) | 73 if (!event.HasNativeEvent()) |
74 return 0; | 74 return 0; |
75 #if defined(USE_XI2_MT) | 75 #if defined(USE_XI2_MT) |
76 ui::DeviceDataManager* manager = ui::DeviceDataManager::GetInstance(); | 76 ui::DeviceDataManagerX11* manager = ui::DeviceDataManagerX11::GetInstance(); |
77 double tracking_id; | 77 double tracking_id; |
78 if (manager->GetEventData(*event.native_event(), | 78 if (manager->GetEventData(*event.native_event(), |
79 ui::DeviceDataManager::DT_TOUCH_TRACKING_ID, | 79 ui::DeviceDataManagerX11::DT_TOUCH_TRACKING_ID, |
80 &tracking_id)) { | 80 &tracking_id)) { |
81 return static_cast<int>(tracking_id); | 81 return static_cast<int>(tracking_id); |
82 } | 82 } |
83 #endif | 83 #endif |
84 return 0; | 84 return 0; |
85 } | 85 } |
86 | 86 |
87 int GetSourceDeviceId(const ui::TouchEvent& event) { | 87 int GetSourceDeviceId(const ui::TouchEvent& event) { |
88 if (!event.HasNativeEvent()) | 88 if (!event.HasNativeEvent()) |
89 return 0; | 89 return 0; |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 RootWindowController* controller) { | 479 RootWindowController* controller) { |
480 controller->set_touch_hud_debug(this); | 480 controller->set_touch_hud_debug(this); |
481 } | 481 } |
482 | 482 |
483 void TouchHudDebug::UnsetHudForRootWindowController( | 483 void TouchHudDebug::UnsetHudForRootWindowController( |
484 RootWindowController* controller) { | 484 RootWindowController* controller) { |
485 controller->set_touch_hud_debug(NULL); | 485 controller->set_touch_hud_debug(NULL); |
486 } | 486 } |
487 | 487 |
488 } // namespace ash | 488 } // namespace ash |
OLD | NEW |