| OLD | NEW |
| 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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void PlatformEventSource::RemovePlatformEventDispatcher( | 41 void PlatformEventSource::RemovePlatformEventDispatcher( |
| 42 PlatformEventDispatcher* dispatcher) { | 42 PlatformEventDispatcher* dispatcher) { |
| 43 dispatchers_.RemoveObserver(dispatcher); | 43 dispatchers_.RemoveObserver(dispatcher); |
| 44 OnDispatcherListChanged(); | 44 OnDispatcherListChanged(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 std::unique_ptr<ScopedEventDispatcher> PlatformEventSource::OverrideDispatcher( | 47 std::unique_ptr<ScopedEventDispatcher> PlatformEventSource::OverrideDispatcher( |
| 48 PlatformEventDispatcher* dispatcher) { | 48 PlatformEventDispatcher* dispatcher) { |
| 49 CHECK(dispatcher); | 49 CHECK(dispatcher); |
| 50 overridden_dispatcher_restored_ = false; | 50 overridden_dispatcher_restored_ = false; |
| 51 return base::WrapUnique( | 51 return base::MakeUnique<ScopedEventDispatcher>(&overridden_dispatcher_, |
| 52 new ScopedEventDispatcher(&overridden_dispatcher_, dispatcher)); | 52 dispatcher); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void PlatformEventSource::StopCurrentEventStream() { | 55 void PlatformEventSource::StopCurrentEventStream() { |
| 56 } | 56 } |
| 57 | 57 |
| 58 void PlatformEventSource::AddPlatformEventObserver( | 58 void PlatformEventSource::AddPlatformEventObserver( |
| 59 PlatformEventObserver* observer) { | 59 PlatformEventObserver* observer) { |
| 60 CHECK(observer); | 60 CHECK(observer); |
| 61 observers_.AddObserver(observer); | 61 observers_.AddObserver(observer); |
| 62 } | 62 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 void PlatformEventSource::OnDispatcherListChanged() { | 104 void PlatformEventSource::OnDispatcherListChanged() { |
| 105 } | 105 } |
| 106 | 106 |
| 107 void PlatformEventSource::OnOverriddenDispatcherRestored() { | 107 void PlatformEventSource::OnOverriddenDispatcherRestored() { |
| 108 CHECK(overridden_dispatcher_); | 108 CHECK(overridden_dispatcher_); |
| 109 overridden_dispatcher_restored_ = true; | 109 overridden_dispatcher_restored_ = true; |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace ui | 112 } // namespace ui |
| OLD | NEW |