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

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

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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/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
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
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
OLDNEW
« no previous file with comments | « ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc ('k') | ui/events/platform/x11/x11_event_source_glib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698