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

Unified Diff: base/message_pump_aurax11.cc

Issue 11593015: MessagePumpAuraX11: Make root_window_dispatchers_ an ObserverList. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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 | « base/message_pump_aurax11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_aurax11.cc
===================================================================
--- base/message_pump_aurax11.cc (revision 173799)
+++ base/message_pump_aurax11.cc (working copy)
@@ -169,19 +169,12 @@
void MessagePumpAuraX11::AddDispatcherForRootWindow(
MessagePumpDispatcher* dispatcher) {
- DCHECK(std::find(root_window_dispatchers_.begin(),
- root_window_dispatchers_.end(),
- dispatcher) ==
- root_window_dispatchers_.end());
- root_window_dispatchers_.push_back(dispatcher);
+ root_window_dispatchers_.AddObserver(dispatcher);
}
void MessagePumpAuraX11::RemoveDispatcherForRootWindow(
MessagePumpDispatcher* dispatcher) {
- root_window_dispatchers_.erase(
- std::remove(root_window_dispatchers_.begin(),
- root_window_dispatchers_.end(),
- dispatcher));
+ root_window_dispatchers_.RemoveObserver(dispatcher);
}
bool MessagePumpAuraX11::DispatchXEvents() {
@@ -303,11 +296,8 @@
}
if (FindEventTarget(xev) == x_root_window_) {
- for (Dispatchers::const_iterator it = root_window_dispatchers_.begin();
- it != root_window_dispatchers_.end();
- ++it) {
- (*it)->Dispatch(xev);
- }
+ FOR_EACH_OBSERVER(MessagePumpDispatcher, root_window_dispatchers_,
+ Dispatch(xev));
return true;
}
MessagePumpDispatcher* dispatcher = GetDispatcherForXEvent(xev);
« no previous file with comments | « base/message_pump_aurax11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698