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

Unified Diff: services/window_manager/view_event_dispatcher.h

Issue 1536713004: Revert "Delete the ViewManager and WindowManager services." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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 | « services/window_manager/run_all_unittests.cc ('k') | services/window_manager/view_event_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/window_manager/view_event_dispatcher.h
diff --git a/services/window_manager/view_event_dispatcher.h b/services/window_manager/view_event_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..399939e7be373035f198b93e47f5dd4705b80fc4
--- /dev/null
+++ b/services/window_manager/view_event_dispatcher.h
@@ -0,0 +1,47 @@
+// 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 SERVICES_WINDOW_MANAGER_VIEW_EVENT_DISPATCHER_H_
+#define SERVICES_WINDOW_MANAGER_VIEW_EVENT_DISPATCHER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "ui/events/event_processor.h"
+#include "ui/events/event_target.h"
+
+namespace window_manager {
+
+class ViewTarget;
+
+class ViewEventDispatcher : public ui::EventProcessor {
+ public:
+ ViewEventDispatcher();
+ ~ViewEventDispatcher() override;
+
+ void SetRootViewTarget(ViewTarget* root_view_target);
+
+ private:
+ // Overridden from ui::EventProcessor:
+ ui::EventTarget* GetRootTarget() override;
+ void OnEventProcessingStarted(ui::Event* event) override;
+
+ // Overridden from ui::EventDispatcherDelegate.
+ bool CanDispatchToTarget(ui::EventTarget* target) override;
+ ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target,
+ ui::Event* event) override;
+ ui::EventDispatchDetails PostDispatchEvent(
+ ui::EventTarget* target, const ui::Event& event) override;
+
+ // We keep a weak reference to ViewTarget*, which corresponds to the root of
+ // the mojo::View tree.
+ ViewTarget* root_view_target_;
+
+ ViewTarget* event_dispatch_target_;
+ ViewTarget* old_dispatch_target_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewEventDispatcher);
+};
+
+} // namespace window_manager
+
+#endif // SERVICES_WINDOW_MANAGER_VIEW_EVENT_DISPATCHER_H_
« no previous file with comments | « services/window_manager/run_all_unittests.cc ('k') | services/window_manager/view_event_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698