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

Unified Diff: ui/events/platform/scoped_event_dispatcher.cc

Issue 203483004: events: Introduce PlatformEventDispatcher and PlatformEventSource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests Created 6 years, 9 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/platform/scoped_event_dispatcher.cc
diff --git a/ui/events/platform/scoped_event_dispatcher.cc b/ui/events/platform/scoped_event_dispatcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b0941ab851394191a2374af1b8f79ea2326a8723
--- /dev/null
+++ b/ui/events/platform/scoped_event_dispatcher.cc
@@ -0,0 +1,21 @@
+// 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.
+
+#include "ui/events/platform/scoped_event_dispatcher.h"
+
+#include "ui/events/platform/platform_event_source.h"
+
+namespace ui {
+
+ScopedEventDispatcher::ScopedEventDispatcher(
+ PlatformEventDispatcher** scoped_dispatcher,
+ PlatformEventDispatcher* new_dispatcher)
+ : original_(*scoped_dispatcher),
+ restore_(scoped_dispatcher, new_dispatcher) {}
+
+ScopedEventDispatcher::~ScopedEventDispatcher() {
+ PlatformEventSource::GetInstance()->OnOverriddenDispatcherRestored();
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698