| 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_uma.h" | 5 #include "ash/touch/touch_uma.h" |
| 6 | 6 |
| 7 #include "ash/common/wm_shell.h" | 7 #include "ash/common/wm_shell.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
| 11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
| 12 #include "ui/aura/window_event_dispatcher.h" | 12 #include "ui/aura/window_event_dispatcher.h" |
| 13 #include "ui/aura/window_property.h" | 13 #include "ui/base/class_property.h" |
| 14 #include "ui/events/event.h" | 14 #include "ui/events/event.h" |
| 15 #include "ui/events/event_utils.h" | 15 #include "ui/events/event_utils.h" |
| 16 #include "ui/gfx/geometry/point_conversions.h" | 16 #include "ui/gfx/geometry/point_conversions.h" |
| 17 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
| 18 | 18 |
| 19 #if defined(USE_X11) | 19 #if defined(USE_X11) |
| 20 #include <X11/extensions/XInput2.h> | 20 #include <X11/extensions/XInput2.h> |
| 21 #include <X11/Xlib.h> | 21 #include <X11/Xlib.h> |
| 22 #endif | 22 #endif |
| 23 | 23 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // Last time-stamp of the last touch-end event. | 35 // Last time-stamp of the last touch-end event. |
| 36 base::TimeTicks last_release_time_; | 36 base::TimeTicks last_release_time_; |
| 37 | 37 |
| 38 // Stores the time of the last touch released on this window (if there was a | 38 // Stores the time of the last touch released on this window (if there was a |
| 39 // multi-touch gesture on the window, then this is the release-time of the | 39 // multi-touch gesture on the window, then this is the release-time of the |
| 40 // last touch on the window). | 40 // last touch on the window). |
| 41 base::TimeTicks last_mt_time_; | 41 base::TimeTicks last_mt_time_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 DEFINE_OWNED_WINDOW_PROPERTY_KEY(WindowTouchDetails, kWindowTouchDetails, NULL); | 44 DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(WindowTouchDetails, |
| 45 kWindowTouchDetails, |
| 46 NULL); |
| 45 } | 47 } |
| 46 | 48 |
| 47 DECLARE_WINDOW_PROPERTY_TYPE(WindowTouchDetails*); | 49 DECLARE_UI_CLASS_PROPERTY_TYPE(WindowTouchDetails*); |
| 48 | 50 |
| 49 namespace ash { | 51 namespace ash { |
| 50 | 52 |
| 51 // static | 53 // static |
| 52 TouchUMA* TouchUMA::GetInstance() { | 54 TouchUMA* TouchUMA::GetInstance() { |
| 53 return base::Singleton<TouchUMA>::get(); | 55 return base::Singleton<TouchUMA>::get(); |
| 54 } | 56 } |
| 55 | 57 |
| 56 void TouchUMA::RecordGestureEvent(aura::Window* target, | 58 void TouchUMA::RecordGestureEvent(aura::Window* target, |
| 57 const ui::GestureEvent& event) { | 59 const ui::GestureEvent& event) { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 return GESTURE_OMNIBOX_SCROLL; | 294 return GESTURE_OMNIBOX_SCROLL; |
| 293 if (event.type() == ui::ET_GESTURE_PINCH_BEGIN) | 295 if (event.type() == ui::ET_GESTURE_PINCH_BEGIN) |
| 294 return GESTURE_OMNIBOX_PINCH; | 296 return GESTURE_OMNIBOX_PINCH; |
| 295 return GESTURE_UNKNOWN; | 297 return GESTURE_UNKNOWN; |
| 296 } | 298 } |
| 297 | 299 |
| 298 return GESTURE_UNKNOWN; | 300 return GESTURE_UNKNOWN; |
| 299 } | 301 } |
| 300 | 302 |
| 301 } // namespace ash | 303 } // namespace ash |
| OLD | NEW |