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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 return 0; | 89 return 0; |
90 } | 90 } |
91 | 91 |
92 // A TouchPointLog represents a single touch-event of a touch point. | 92 // A TouchPointLog represents a single touch-event of a touch point. |
93 struct TouchPointLog { | 93 struct TouchPointLog { |
94 public: | 94 public: |
95 explicit TouchPointLog(const ui::TouchEvent& touch) | 95 explicit TouchPointLog(const ui::TouchEvent& touch) |
96 : id(touch.touch_id()), | 96 : id(touch.touch_id()), |
97 type(touch.type()), | 97 type(touch.type()), |
98 location(touch.root_location()), | 98 location(touch.root_location()), |
99 timestamp(touch.time_stamp().InMillisecondsF()), | 99 timestamp((touch.time_stamp() - base::TimeTicks()).InMillisecondsF()), |
majidvp
2016/05/16 12:49:50
This is the pattern I use when it is needed to con
| |
100 radius_x(touch.pointer_details().radius_x), | 100 radius_x(touch.pointer_details().radius_x), |
101 radius_y(touch.pointer_details().radius_y), | 101 radius_y(touch.pointer_details().radius_y), |
102 pressure(touch.pointer_details().force), | 102 pressure(touch.pointer_details().force), |
103 tracking_id(GetTrackingId(touch)), | 103 tracking_id(GetTrackingId(touch)), |
104 source_device(touch.source_device_id()) {} | 104 source_device(touch.source_device_id()) {} |
105 | 105 |
106 // Populates a dictionary value with all the information about the touch | 106 // Populates a dictionary value with all the information about the touch |
107 // point. | 107 // point. |
108 std::unique_ptr<base::DictionaryValue> GetAsDictionary() const { | 108 std::unique_ptr<base::DictionaryValue> GetAsDictionary() const { |
109 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 109 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
473 RootWindowController* controller) { | 473 RootWindowController* controller) { |
474 controller->set_touch_hud_debug(this); | 474 controller->set_touch_hud_debug(this); |
475 } | 475 } |
476 | 476 |
477 void TouchHudDebug::UnsetHudForRootWindowController( | 477 void TouchHudDebug::UnsetHudForRootWindowController( |
478 RootWindowController* controller) { | 478 RootWindowController* controller) { |
479 controller->set_touch_hud_debug(NULL); | 479 controller->set_touch_hud_debug(NULL); |
480 } | 480 } |
481 | 481 |
482 } // namespace ash | 482 } // namespace ash |
OLD | NEW |