| 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "custom_events.h" | 7 #include "custom_events.h" |
| 8 | 8 |
| 9 namespace event_queue { | |
| 10 | |
| 11 // Convert a given modifier to a descriptive string. Note that the actual | 9 // Convert a given modifier to a descriptive string. Note that the actual |
| 12 // declared type of modifier in each of the event classes is uint32_t, but it is | 10 // declared type of modifier in each of the event classes is uint32_t, but it is |
| 13 // expected to be interpreted as a bitfield of 'or'ed PP_InputEvent_Modifier | 11 // expected to be interpreted as a bitfield of 'or'ed PP_InputEvent_Modifier |
| 14 // values. | 12 // values. |
| 15 std::string ModifierToString(uint32_t modifier) { | 13 std::string ModifierToString(uint32_t modifier) { |
| 16 std::string s; | 14 std::string s; |
| 17 if (modifier & kShiftKeyModifier) { | 15 if (modifier & kShiftKeyModifier) { |
| 18 s += "shift "; | 16 s += "shift "; |
| 19 } | 17 } |
| 20 if (modifier & kControlKeyModifier) { | 18 if (modifier & kControlKeyModifier) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 stream << " x[" << touch.id << "]:" << touch.x << " y[" << touch.id | 141 stream << " x[" << touch.id << "]:" << touch.x << " y[" << touch.id |
| 144 << "]:" << touch.y << " radii_x[" << touch.id | 142 << "]:" << touch.y << " radii_x[" << touch.id |
| 145 << "]:" << touch.radii_x << " radii_y[" << touch.id | 143 << "]:" << touch.radii_x << " radii_y[" << touch.id |
| 146 << "]:" << touch.radii_y << " angle[" << touch.id | 144 << "]:" << touch.radii_y << " angle[" << touch.id |
| 147 << "]:" << touch.angle << " pressure[" << touch.id | 145 << "]:" << touch.angle << " pressure[" << touch.id |
| 148 << "]:" << touch.pressure; | 146 << "]:" << touch.pressure; |
| 149 } | 147 } |
| 150 stream << " time:" << timestamp_ << "\n"; | 148 stream << " time:" << timestamp_ << "\n"; |
| 151 return stream.str(); | 149 return stream.str(); |
| 152 } | 150 } |
| 153 | |
| 154 } // end namespace | |
| OLD | NEW |