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

Side by Side Diff: extensions/browser/api/display_source/display_source_event_router.cc

Issue 1902873002: Convert //extensions/browser/api from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "extensions/browser/api/display_source/display_source_event_router.h" 5 #include "extensions/browser/api/display_source/display_source_event_router.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/public/browser/browser_context.h" 9 #include "content/public/browser/browser_context.h"
10 #include "extensions/browser/api/display_source/display_source_api.h" 10 #include "extensions/browser/api/display_source/display_source_api.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 listening_ = should_listen; 81 listening_ = should_listen;
82 } 82 }
83 83
84 void DisplaySourceEventRouter::OnSinksUpdated( 84 void DisplaySourceEventRouter::OnSinksUpdated(
85 const DisplaySourceSinkInfoList& sinks) { 85 const DisplaySourceSinkInfoList& sinks) {
86 EventRouter* event_router = EventRouter::Get(browser_context_); 86 EventRouter* event_router = EventRouter::Get(browser_context_);
87 if (!event_router) 87 if (!event_router)
88 return; 88 return;
89 scoped_ptr<base::ListValue> args( 89 std::unique_ptr<base::ListValue> args(
90 api::display_source::OnSinksUpdated::Create(sinks)); 90 api::display_source::OnSinksUpdated::Create(sinks));
91 scoped_ptr<Event> sinks_updated_event(new Event( 91 std::unique_ptr<Event> sinks_updated_event(new Event(
92 events::DISPLAY_SOURCE_ON_SINKS_UPDATED, 92 events::DISPLAY_SOURCE_ON_SINKS_UPDATED,
93 api::display_source::OnSinksUpdated::kEventName, std::move(args))); 93 api::display_source::OnSinksUpdated::kEventName, std::move(args)));
94 event_router->BroadcastEvent(std::move(sinks_updated_event)); 94 event_router->BroadcastEvent(std::move(sinks_updated_event));
95 } 95 }
96 96
97 DisplaySourceEventRouter* DisplaySourceEventRouter::Create( 97 DisplaySourceEventRouter* DisplaySourceEventRouter::Create(
98 content::BrowserContext* browser_context) { 98 content::BrowserContext* browser_context) {
99 return new DisplaySourceEventRouter(browser_context); 99 return new DisplaySourceEventRouter(browser_context);
100 } 100 }
101 101
102 } // namespace extensions 102 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698