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

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

Issue 19624005: Add InputEvent and EventPacket types for batched input delivery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Win export fix Created 7 years, 3 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
« no previous file with comments | « content/common/input/OWNERS ('k') | content/common/input/event_packet.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_INPUT_EVENT_PACKET_H_
6 #define CONTENT_COMMON_INPUT_EVENT_PACKET_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h"
11 #include "content/common/content_export.h"
12
13 namespace content {
14
15 class InputEvent;
16
17 // An id'ed sequence of InputEvents.
18 class CONTENT_EXPORT EventPacket {
19 public:
20 typedef ScopedVector<InputEvent> InputEvents;
21
22 EventPacket();
23 ~EventPacket();
24
25 // Only a non-NULL and valid |event| will be accepted and added to the packet.
26 // Returns true if |event| was added, and false otherwise.
27 bool Add(scoped_ptr<InputEvent> event);
28
29 void set_id(int64 id) { id_ = id; }
30 int64 id() const { return id_; }
31
32 // Accessor functions for convenience.
33 bool empty() const { return events_.empty(); }
34 size_t size() const { return events_.size(); }
35 InputEvents::const_iterator begin() const { return events_.end(); }
36 InputEvents::const_iterator end() const { return events_.end(); }
37 const InputEvents& events() const { return events_; }
38
39 protected:
40 int64 id_;
41 InputEvents events_;
42
43 private:
44 DISALLOW_COPY_AND_ASSIGN(EventPacket);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_COMMON_INPUT_EVENT_PACKET_H_
OLDNEW
« no previous file with comments | « content/common/input/OWNERS ('k') | content/common/input/event_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698