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

Unified Diff: ui/events/event.h

Issue 492863002: mojo: Plumb through sufficient context to make real blink::WebInputEvents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ozone compile. Created 6 years, 4 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/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index 6b8f95c5b15971d8835de724673b2976269bea67..76a6b482529cb3a35b9ea758a8e9811df094470d 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -10,6 +10,7 @@
#include "base/event_types.h"
#include "base/gtest_prod_util.h"
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "ui/events/event_constants.h"
#include "ui/events/gesture_event_details.h"
@@ -591,6 +592,36 @@ class EVENTS_EXPORT KeyEvent : public Event {
const std::string& code,
int flags);
+ KeyEvent(const KeyEvent& rhs);
+
+ KeyEvent& operator=(const KeyEvent& rhs);
+
+ virtual ~KeyEvent();
+
+ // Used for synthetic events inside of mojo.
+ //
+ // TODO(erg): While we transition to mojo, we have to hack around a mismatch
+ // in our event types. Our ui::Events don't really have all the data we need
+ // to process key events, and we instead do per-platform conversions with
+ // native HWNDs or XEvents. And we can't reliably send those native data
+ // types across mojo types in a cross-platform way. So instead, we set the
+ // resulting data when read across IPC boundaries.
+ //
+ // Please note that |windows_key_code| does not necessarily have the same
+ // value as |key_code()|. Long term, those values will go away as we
+ // transition to mojo.
+ void SetSelfContainedKeyEventData(int32_t windows_key_code,
sky 2014/08/21 15:44:42 SelfContained? Maybe SetExtendedData? (KeyEvent is
+ int32_t platform_key_code,
+ base::char16 text,
+ base::char16 unmodified_text);
+
+ // These accessors will first return data from a native event if it exists,
+ // and will then check explicitly set values from
+ // SetSelfContainedKeyEventData().
+ int32_t GetWindowsKeyCode() const;
+ base::char16 GetKeyText() const;
+ base::char16 GetKeyUnmodifiedText() const;
+
// This bypasses the normal mapping from keystroke events to characters,
// which allows an I18N virtual keyboard to fabricate a keyboard event that
// does not have a corresponding KeyboardCode (example: U+00E1 Latin small
@@ -659,6 +690,13 @@ class EVENTS_EXPORT KeyEvent : public Event {
// e.g. CTRL+A has '\x01'.
base::char16 character_;
+ // Parts of our event handling require raw native events (see both the
+ // windows and linux implementations of web_input_event in content/). Because
+ // mojo instead serializes and deserializes events in potentially different
+ // processes, we need to have a mechanism to keep track of this data.
+ struct ExtendedMojoData;
+ scoped_ptr<ExtendedMojoData> extended_mojo_data_;
+
static bool IsRepeated(const KeyEvent& event);
static KeyEvent* last_key_event_;
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event.cc » ('j') | ui/events/event.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698