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

Unified Diff: ui/aura/env.cc

Issue 10960015: aura: Start converting event-filters into event-handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: leak Created 8 years, 3 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
« ui/aura/env.h ('K') | « ui/aura/env.h ('k') | ui/aura/root_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env.cc
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index e787c9957b1fb2e2ebaee34c6d552247e9566698..08e3e1db4b48d2b4aa5c4e18ea3a0f8b275ec90a 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -97,8 +97,32 @@ void Env::SetDisplayManager(DisplayManager* display_manager) {
#endif
}
-void Env::SetEventFilter(EventFilter* event_filter) {
- event_filter_.reset(event_filter);
+void Env::AddPreTargetEventHandler(ui::EventHandler* handler) {
+ if (handler)
+ pre_target_handlers_.push_back(handler);
+}
+
+void Env::RemovePreTargetEventHandler(ui::EventHandler* handler) {
+ ui::EventHandlerList::iterator find =
+ std::find(pre_target_handlers_.begin(),
+ pre_target_handlers_.end(),
+ handler);
+ if (find != pre_target_handlers_.end())
+ pre_target_handlers_.erase(find);
+}
+
+void Env::AddPostTargetEventHandler(ui::EventHandler* handler) {
+ if (handler)
+ post_target_handlers_.push_back(handler);
+}
+
+void Env::RemovePostTargetEventHandler(ui::EventHandler* handler) {
+ ui::EventHandlerList::iterator find =
+ std::remove(post_target_handlers_.begin(),
+ post_target_handlers_.end(),
+ handler);
+ if (find != post_target_handlers_.end())
+ post_target_handlers_.erase(find);
}
#if !defined(OS_MACOSX)
« ui/aura/env.h ('K') | « ui/aura/env.h ('k') | ui/aura/root_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698