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

Side by Side Diff: ui/events/platform/platform_event_source.cc

Issue 1162943002: Replace more ObserverList with base::ObserverList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@observer
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « ui/events/platform/platform_event_source.h ('k') | ui/gfx/display_change_notifier.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/platform/platform_event_source.h" 5 #include "ui/events/platform/platform_event_source.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "ui/events/platform/platform_event_dispatcher.h" 10 #include "ui/events/platform/platform_event_dispatcher.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 uint32_t action = POST_DISPATCH_PERFORM_DEFAULT; 69 uint32_t action = POST_DISPATCH_PERFORM_DEFAULT;
70 70
71 FOR_EACH_OBSERVER(PlatformEventObserver, observers_, 71 FOR_EACH_OBSERVER(PlatformEventObserver, observers_,
72 WillProcessEvent(platform_event)); 72 WillProcessEvent(platform_event));
73 // Give the overridden dispatcher a chance to dispatch the event first. 73 // Give the overridden dispatcher a chance to dispatch the event first.
74 if (overridden_dispatcher_) 74 if (overridden_dispatcher_)
75 action = overridden_dispatcher_->DispatchEvent(platform_event); 75 action = overridden_dispatcher_->DispatchEvent(platform_event);
76 76
77 if ((action & POST_DISPATCH_PERFORM_DEFAULT) && 77 if ((action & POST_DISPATCH_PERFORM_DEFAULT) &&
78 dispatchers_.might_have_observers()) { 78 dispatchers_.might_have_observers()) {
79 ObserverList<PlatformEventDispatcher>::Iterator iter(&dispatchers_); 79 base::ObserverList<PlatformEventDispatcher>::Iterator iter(&dispatchers_);
80 while (PlatformEventDispatcher* dispatcher = iter.GetNext()) { 80 while (PlatformEventDispatcher* dispatcher = iter.GetNext()) {
81 if (dispatcher->CanDispatchEvent(platform_event)) 81 if (dispatcher->CanDispatchEvent(platform_event))
82 action = dispatcher->DispatchEvent(platform_event); 82 action = dispatcher->DispatchEvent(platform_event);
83 if (action & POST_DISPATCH_STOP_PROPAGATION) 83 if (action & POST_DISPATCH_STOP_PROPAGATION)
84 break; 84 break;
85 } 85 }
86 } 86 }
87 FOR_EACH_OBSERVER(PlatformEventObserver, observers_, 87 FOR_EACH_OBSERVER(PlatformEventObserver, observers_,
88 DidProcessEvent(platform_event)); 88 DidProcessEvent(platform_event));
89 89
(...skipping 12 matching lines...) Expand all
102 102
103 void PlatformEventSource::OnDispatcherListChanged() { 103 void PlatformEventSource::OnDispatcherListChanged() {
104 } 104 }
105 105
106 void PlatformEventSource::OnOverriddenDispatcherRestored() { 106 void PlatformEventSource::OnOverriddenDispatcherRestored() {
107 CHECK(overridden_dispatcher_); 107 CHECK(overridden_dispatcher_);
108 overridden_dispatcher_restored_ = true; 108 overridden_dispatcher_restored_ = true;
109 } 109 }
110 110
111 } // namespace ui 111 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/platform/platform_event_source.h ('k') | ui/gfx/display_change_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698