| 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/touch/touch_observer_hud.h" | 5 #include "ash/touch/touch_observer_hud.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "ui/gfx/transform.h" | 29 #include "ui/gfx/transform.h" |
| 30 #include "ui/views/background.h" | 30 #include "ui/views/background.h" |
| 31 #include "ui/views/controls/label.h" | 31 #include "ui/views/controls/label.h" |
| 32 #include "ui/views/layout/box_layout.h" | 32 #include "ui/views/layout/box_layout.h" |
| 33 #include "ui/views/widget/widget.h" | 33 #include "ui/views/widget/widget.h" |
| 34 | 34 |
| 35 #if defined(USE_X11) | 35 #if defined(USE_X11) |
| 36 #include <X11/extensions/XInput2.h> | 36 #include <X11/extensions/XInput2.h> |
| 37 #include <X11/Xlib.h> | 37 #include <X11/Xlib.h> |
| 38 | 38 |
| 39 #include "ui/base/x/device_data_manager.h" | 39 #include "ui/base/x/valuators.h" |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 namespace ash { | 42 namespace ash { |
| 43 namespace internal { | 43 namespace internal { |
| 44 | 44 |
| 45 const int kPointRadius = 20; | 45 const int kPointRadius = 20; |
| 46 const SkColor kColors[] = { | 46 const SkColor kColors[] = { |
| 47 SK_ColorYELLOW, | 47 SK_ColorYELLOW, |
| 48 SK_ColorGREEN, | 48 SK_ColorGREEN, |
| 49 SK_ColorRED, | 49 SK_ColorRED, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 default: | 81 default: |
| 82 break; | 82 break; |
| 83 } | 83 } |
| 84 return "?"; | 84 return "?"; |
| 85 } | 85 } |
| 86 | 86 |
| 87 int GetTrackingId(const ui::TouchEvent& event) { | 87 int GetTrackingId(const ui::TouchEvent& event) { |
| 88 if (!event.HasNativeEvent()) | 88 if (!event.HasNativeEvent()) |
| 89 return 0; | 89 return 0; |
| 90 #if defined(USE_XI2_MT) | 90 #if defined(USE_XI2_MT) |
| 91 ui::DeviceDataManager* manager = ui::DeviceDataManager::GetInstance(); | 91 ui::ValuatorTracker* valuators = ui::ValuatorTracker::GetInstance(); |
| 92 double tracking_id; | 92 double tracking_id; |
| 93 if (manager->GetEventData(*event.native_event(), | 93 if (valuators->ExtractValuator(*event.native_event(), |
| 94 ui::DeviceDataManager::DT_TOUCH_TRACKING_ID, | 94 ui::ValuatorTracker::VAL_TRACKING_ID, |
| 95 &tracking_id)) { | 95 &tracking_id)) { |
| 96 return static_cast<int>(tracking_id); | 96 return static_cast<int>(tracking_id); |
| 97 } | 97 } |
| 98 #endif | 98 #endif |
| 99 return 0; | 99 return 0; |
| 100 } | 100 } |
| 101 | 101 |
| 102 int GetSourceDeviceId(const ui::TouchEvent& event) { | 102 int GetSourceDeviceId(const ui::TouchEvent& event) { |
| 103 if (!event.HasNativeEvent()) | 103 if (!event.HasNativeEvent()) |
| 104 return 0; | 104 return 0; |
| 105 #if defined(USE_X11) | 105 #if defined(USE_X11) |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 internal::kShellWindowId_OverlayContainer)); | 723 internal::kShellWindowId_OverlayContainer)); |
| 724 | 724 |
| 725 RootWindowController* controller = GetRootWindowController(root_window_); | 725 RootWindowController* controller = GetRootWindowController(root_window_); |
| 726 controller->set_touch_observer_hud(this); | 726 controller->set_touch_observer_hud(this); |
| 727 | 727 |
| 728 root_window_->AddPreTargetHandler(this); | 728 root_window_->AddPreTargetHandler(this); |
| 729 } | 729 } |
| 730 | 730 |
| 731 } // namespace internal | 731 } // namespace internal |
| 732 } // namespace ash | 732 } // namespace ash |
| OLD | NEW |