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

Side by Side Diff: ui/events/ozone/evdev/event_converter_evdev.h

Issue 616633002: [Ozone-Evdev] Propagate touchscreen device information to DeviceDataManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 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 | « no previous file | ui/events/ozone/evdev/event_converter_evdev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" 11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
12 #include "ui/gfx/geometry/size.h"
12 13
13 namespace ui { 14 namespace ui {
14 15
15 class Event; 16 class Event;
16 17
17 typedef base::Callback<void(Event*)> EventDispatchCallback; 18 typedef base::Callback<void(Event*)> EventDispatchCallback;
18 19
19 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev 20 class EVENTS_OZONE_EVDEV_EXPORT EventConverterEvdev
20 : public base::MessagePumpLibevent::Watcher { 21 : public base::MessagePumpLibevent::Watcher {
21 public: 22 public:
22 EventConverterEvdev(int fd, const base::FilePath& path); 23 EventConverterEvdev(int fd, const base::FilePath& path, int id);
23 virtual ~EventConverterEvdev(); 24 virtual ~EventConverterEvdev();
24 25
26 int id() const { return id_; }
27
25 // Start reading events. 28 // Start reading events.
26 void Start(); 29 void Start();
27 30
28 // Stop reading events. 31 // Stop reading events.
29 void Stop(); 32 void Stop();
30 33
34 // Returns true of the converter is used for a touchscreen device.
35 virtual bool HasTouchscreen() const;
36
37 // Returns the size of the touchscreen device if the converter is used for a
38 // touchscreen device.
39 virtual gfx::Size GetTouchscreenSize() const;
40
31 protected: 41 protected:
32 // base::MessagePumpLibevent::Watcher: 42 // base::MessagePumpLibevent::Watcher:
33 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; 43 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
34 44
35 // File descriptor to read. 45 // File descriptor to read.
36 int fd_; 46 int fd_;
37 47
38 // Path to input device. 48 // Path to input device.
39 base::FilePath path_; 49 base::FilePath path_;
40 50
51 // Uniquely identifies an event converter.
52 int id_;
53
41 // Controller for watching the input fd. 54 // Controller for watching the input fd.
42 base::MessagePumpLibevent::FileDescriptorWatcher controller_; 55 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
43 56
44 private: 57 private:
45 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev); 58 DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev);
46 }; 59 };
47 60
48 } // namespace ui 61 } // namespace ui
49 62
50 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_ 63 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698