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

Unified Diff: ui/views/widget/root_view.h

Issue 12207092: views: Dispatch key, touch, scroll and gesture events using the EventDispatch interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-before-land Created 7 years, 10 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/views/view.cc ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/root_view.h
diff --git a/ui/views/widget/root_view.h b/ui/views/widget/root_view.h
index e8be22752a453d5c10a6985f158d8b79b9e1f1b8..377bf24cc4b6daf73592a9af9866366d7998d7a8 100644
--- a/ui/views/widget/root_view.h
+++ b/ui/views/widget/root_view.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/memory/ref_counted.h"
+#include "ui/base/events/event_dispatcher.h"
#include "ui/views/focus/focus_manager.h"
#include "ui/views/focus/focus_search.h"
#include "ui/views/view.h"
@@ -37,7 +38,9 @@ namespace internal {
// TODO(beng): Clean up API further, make Widget a friend.
// TODO(sky): We don't really want to export this class.
//
-class VIEWS_EXPORT RootView : public View, public FocusTraversable {
+class VIEWS_EXPORT RootView : public View,
+ public FocusTraversable,
+ public ui::EventDispatcherDelegate {
public:
static const char kViewClassName[];
@@ -133,6 +136,11 @@ class VIEWS_EXPORT RootView : public View, public FocusTraversable {
// be applied to the point prior to calling this).
void SetMouseLocationAndFlags(const ui::MouseEvent& event);
+ void DispatchEventToTarget(View* target, ui::Event* event);
+
+ // Overridden from ui::EventDispatcherDelegate:
+ virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE;
+
//////////////////////////////////////////////////////////////////////////////
// Tree operations -----------------------------------------------------------
@@ -187,6 +195,8 @@ class VIEWS_EXPORT RootView : public View, public FocusTraversable {
// wrapped inside native components, and is used for the focus traversal.
View* focus_traversable_parent_view_;
+ View* event_dispatch_target_;
+
// Drag and drop -------------------------------------------------------------
// Tracks drag state for a view.
« no previous file with comments | « ui/views/view.cc ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698