Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Side by Side Diff: content/common/input/input_event_stream_validator.h

Issue 290473006: Add a TouchEventStreamValidator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR 5 #ifndef CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR
6 #define CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR 6 #define CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR
7 7
8 #include <string>
9
8 #include "content/common/input/gesture_event_stream_validator.h" 10 #include "content/common/input/gesture_event_stream_validator.h"
11 #include "content/common/input/touch_event_stream_validator.h"
9 12
10 namespace blink { 13 namespace blink {
11 class WebInputEvent; 14 class WebInputEvent;
12 } 15 }
13 16
14 namespace content { 17 namespace content {
15 18
16 // DCHECKs that the stream of WebInputEvents passed to OnEvent is 19 // DCHECKs that the stream of WebInputEvents passed to OnEvent is
17 // valid. Currently only validates WebGestureEvents. 20 // valid. Currently only validates WebGestureEvents.
tdresser 2014/06/03 15:21:07 Update comment.
jdduke (slow) 2014/06/03 19:10:28 Done.
18 class InputEventStreamValidator { 21 class InputEventStreamValidator {
19 public: 22 public:
20 InputEventStreamValidator(); 23 InputEventStreamValidator();
21 ~InputEventStreamValidator(); 24 ~InputEventStreamValidator();
22 void OnEvent(const blink::WebInputEvent&); 25
26 void Validate(const blink::WebInputEvent&);
23 27
24 private: 28 private:
29 bool ValidateImpl(const blink::WebInputEvent&, std::string* error_msg);
30
25 GestureEventStreamValidator gesture_validator_; 31 GestureEventStreamValidator gesture_validator_;
26 bool enabled_; 32 TouchEventStreamValidator touch_validator_;
33 std::string error_msg_;
34 const bool enabled_;
27 35
28 DISALLOW_COPY_AND_ASSIGN(InputEventStreamValidator); 36 DISALLOW_COPY_AND_ASSIGN(InputEventStreamValidator);
29 }; 37 };
30 38
31 } // namespace content 39 } // namespace content
32 40
33 #endif // CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR 41 #endif // CONTENT_COMMON_INPUT_EVENT_STREAM_VALIDATOR
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698