| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 } | 158 } |
| 159 | 159 |
| 160 // Returns true if the WebInputEvent |type| is a touch event. | 160 // Returns true if the WebInputEvent |type| is a touch event. |
| 161 static bool isTouchEventType(int type) | 161 static bool isTouchEventType(int type) |
| 162 { | 162 { |
| 163 return type == TouchStart | 163 return type == TouchStart |
| 164 || type == TouchMove | 164 || type == TouchMove |
| 165 || type == TouchEnd | 165 || type == TouchEnd |
| 166 || type == TouchCancel; | 166 || type == TouchCancel; |
| 167 } | 167 } |
| 168 |
| 169 // Returns true if the WebInputEvent |type| should be handled as user gestur
e. |
| 170 static bool isUserGestureEventType(int type) |
| 171 { |
| 172 return isKeyboardEventType(type) |
| 173 || type == MouseDown |
| 174 || type == MouseUp |
| 175 || type == TouchStart |
| 176 || type == TouchEnd; |
| 177 } |
| 168 }; | 178 }; |
| 169 | 179 |
| 170 // WebKeyboardEvent ----------------------------------------------------------- | 180 // WebKeyboardEvent ----------------------------------------------------------- |
| 171 | 181 |
| 172 class WebKeyboardEvent : public WebInputEvent { | 182 class WebKeyboardEvent : public WebInputEvent { |
| 173 public: | 183 public: |
| 174 // Caps on string lengths so we can make them static arrays and keep | 184 // Caps on string lengths so we can make them static arrays and keep |
| 175 // them PODs. | 185 // them PODs. |
| 176 static const size_t textLengthCap = 4; | 186 static const size_t textLengthCap = 4; |
| 177 | 187 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 WebTouchEvent(unsigned sizeParam = sizeof(WebTouchEvent)) | 313 WebTouchEvent(unsigned sizeParam = sizeof(WebTouchEvent)) |
| 304 : WebInputEvent(sizeParam) | 314 : WebInputEvent(sizeParam) |
| 305 , touchPointsLength(0) | 315 , touchPointsLength(0) |
| 306 { | 316 { |
| 307 } | 317 } |
| 308 }; | 318 }; |
| 309 | 319 |
| 310 } // namespace WebKit | 320 } // namespace WebKit |
| 311 | 321 |
| 312 #endif | 322 #endif |
| OLD | NEW |