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

Unified Diff: ui/events/ozone/evdev/event_converter.h

Issue 137273009: evdev: Factor common code out of key & touch converters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/ozone/evdev/event_converter.h
diff --git a/ui/events/ozone/evdev/key_event_converter.h b/ui/events/ozone/evdev/event_converter.h
similarity index 52%
copy from ui/events/ozone/evdev/key_event_converter.h
copy to ui/events/ozone/evdev/event_converter.h
index 2a7dd6336226cd0015cdac7b327167c69f9da2b9..8aab7cdc455c3ecf6353eaf485375a3fab4a9880 100644
--- a/ui/events/ozone/evdev/key_event_converter.h
+++ b/ui/events/ozone/evdev/event_converter.h
@@ -1,11 +1,12 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_
-#define UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_
+#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_H_
+#define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_H_
#include "base/files/file_path.h"
+#include "base/message_loop/message_pump_ozone.h"
rjkroege 2014/01/24 22:25:36 this is unfortunate. Can it be removed?
spang 2014/01/24 22:56:35 Oops. Removed.
#include "ui/events/event.h"
#include "ui/events/events_export.h"
#include "ui/events/ozone/evdev/event_modifiers.h"
@@ -15,20 +16,21 @@ struct input_event;
namespace ui {
-class EVENTS_EXPORT KeyEventConverterEvdev : public EventConverterOzone {
+class EVENTS_EXPORT EventConverterEvdev : public EventConverterOzone {
public:
- KeyEventConverterEvdev(int fd,
- base::FilePath path,
- EventModifiersEvdev* modifiers);
- virtual ~KeyEventConverterEvdev();
+ EventConverterEvdev(int fd,
+ base::FilePath path,
+ EventModifiersEvdev* modifiers);
+ virtual ~EventConverterEvdev();
// Overidden from base::MessagePumpLibevent::Watcher.
virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
- void ProcessEvents(const struct input_event* inputs, int count);
+ protected:
+ // Process & dispatch events read from the device.
+ virtual void ProcessEvents(const struct input_event* inputs, int count) = 0;
- private:
// File descriptor for the /dev/input/event* instance.
rjkroege 2014/01/24 22:25:36 why can't the instance variables still be private?
spang 2014/01/24 22:56:35 They are used in the subclasses. Would you prefer
int fd_;
@@ -38,12 +40,10 @@ class EVENTS_EXPORT KeyEventConverterEvdev : public EventConverterOzone {
// Shared modifier state.
EventModifiersEvdev* modifiers_;
- void ConvertKeyEvent(int key, int value);
-
- DISALLOW_COPY_AND_ASSIGN(KeyEventConverterEvdev);
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev);
};
} // namspace ui
-#endif // UI_EVENTS_OZONE_EVDEV_KEY_EVENT_CONVERTER_EVDEV_H_
-
+#endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_H_

Powered by Google App Engine
This is Rietveld 408576698