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

Side by Side Diff: chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" 5 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 void TabCaptureRegistry::DispatchStatusChangeEvent( 318 void TabCaptureRegistry::DispatchStatusChangeEvent(
319 const LiveRequest* request) const { 319 const LiveRequest* request) const {
320 if (request->is_anonymous()) 320 if (request->is_anonymous())
321 return; 321 return;
322 322
323 EventRouter* router = EventRouter::Get(browser_context_); 323 EventRouter* router = EventRouter::Get(browser_context_);
324 if (!router) 324 if (!router)
325 return; 325 return;
326 326
327 scoped_ptr<base::ListValue> args(new base::ListValue()); 327 std::unique_ptr<base::ListValue> args(new base::ListValue());
328 tab_capture::CaptureInfo info; 328 tab_capture::CaptureInfo info;
329 request->GetCaptureInfo(&info); 329 request->GetCaptureInfo(&info);
330 args->Append(info.ToValue().release()); 330 args->Append(info.ToValue().release());
331 scoped_ptr<Event> event(new Event(events::TAB_CAPTURE_ON_STATUS_CHANGED, 331 std::unique_ptr<Event> event(
332 tab_capture::OnStatusChanged::kEventName, 332 new Event(events::TAB_CAPTURE_ON_STATUS_CHANGED,
333 std::move(args))); 333 tab_capture::OnStatusChanged::kEventName, std::move(args)));
334 event->restrict_to_browser_context = browser_context_; 334 event->restrict_to_browser_context = browser_context_;
335 335
336 router->DispatchEventToExtension(request->extension_id(), std::move(event)); 336 router->DispatchEventToExtension(request->extension_id(), std::move(event));
337 } 337 }
338 338
339 TabCaptureRegistry::LiveRequest* TabCaptureRegistry::FindRequest( 339 TabCaptureRegistry::LiveRequest* TabCaptureRegistry::FindRequest(
340 const content::WebContents* target_contents) const { 340 const content::WebContents* target_contents) const {
341 for (ScopedVector<LiveRequest>::const_iterator it = requests_.begin(); 341 for (ScopedVector<LiveRequest>::const_iterator it = requests_.begin();
342 it != requests_.end(); ++it) { 342 it != requests_.end(); ++it) {
343 if ((*it)->web_contents() == target_contents) 343 if ((*it)->web_contents() == target_contents)
(...skipping 20 matching lines...) Expand all
364 it != requests_.end(); ++it) { 364 it != requests_.end(); ++it) {
365 if ((*it) == request) { 365 if ((*it) == request) {
366 requests_.erase(it); 366 requests_.erase(it);
367 return; 367 return;
368 } 368 }
369 } 369 }
370 NOTREACHED(); 370 NOTREACHED();
371 } 371 }
372 372
373 } // namespace extensions 373 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698