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

Unified Diff: ui/events/ozone/events_ozone.h

Issue 1287103004: Sync ui/events to chromium @ https://codereview.chromium.org/1210203002 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 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
« no previous file with comments | « ui/events/ozone/evdev/touch_noise/touch_noise_finder_unittest.cc ('k') | ui/events/ozone/events_ozone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/events_ozone.h
diff --git a/ui/events/ozone/events_ozone.h b/ui/events/ozone/events_ozone.h
new file mode 100644
index 0000000000000000000000000000000000000000..ad603cdadd9775370c4ac06e6e309bfa6d7a4b12
--- /dev/null
+++ b/ui/events/ozone/events_ozone.h
@@ -0,0 +1,39 @@
+// 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_EVENTS_OZONE_H_
+#define UI_EVENTS_OZONE_EVENTS_OZONE_H_
+
+#include "base/callback.h"
+#include "base/event_types.h"
+#include "ui/events/events_export.h"
+
+namespace ui {
+
+class Event;
+
+// Wrap a "native" ui::Event in another ui::Event & dispatch it.
+//
+// This is really unfortunate, but exists for two reasons:
+//
+// 1. Some of the ui::Event constructors depend on global state that
+// is only used when building from a "native" event. For example:
+// last_click_event_ is used when constructing MouseEvent from
+// NativeEvent to determine click count.
+//
+// 2. Events contain a reference to a "native event", which some code
+// depends on. The ui::Event might get mutated during dispatch, but
+// the native event won't. Some code depends on the fact that the
+// "native" version of the event is unmodified.
+//
+// We are trying to fix both of these issues, but in the meantime we
+// define NativeEvent == ui::Event.
+//
+EVENTS_EXPORT void DispatchEventFromNativeUiEvent(
+ const base::NativeEvent& native_event,
+ base::Callback<void(ui::Event*)> callback);
+
+} // namespace ui
+
+#endif // UI_EVENTS_OZONE_EVENTS_OZONE_H_
« no previous file with comments | « ui/events/ozone/evdev/touch_noise/touch_noise_finder_unittest.cc ('k') | ui/events/ozone/events_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698