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

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

Issue 2898383002: [Extensions] Make Event::restrict_to_browser_context const. (Closed)
Patch Set: sync @tott Created 3 years, 7 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 return; 420 return;
421 421
422 EventRouter* router = EventRouter::Get(browser_context_); 422 EventRouter* router = EventRouter::Get(browser_context_);
423 if (!router) 423 if (!router)
424 return; 424 return;
425 425
426 std::unique_ptr<base::ListValue> args(new base::ListValue()); 426 std::unique_ptr<base::ListValue> args(new base::ListValue());
427 tab_capture::CaptureInfo info; 427 tab_capture::CaptureInfo info;
428 request->GetCaptureInfo(&info); 428 request->GetCaptureInfo(&info);
429 args->Append(info.ToValue()); 429 args->Append(info.ToValue());
430 std::unique_ptr<Event> event( 430 auto event = base::MakeUnique<Event>(events::TAB_CAPTURE_ON_STATUS_CHANGED,
431 new Event(events::TAB_CAPTURE_ON_STATUS_CHANGED, 431 tab_capture::OnStatusChanged::kEventName,
432 tab_capture::OnStatusChanged::kEventName, std::move(args))); 432 std::move(args), browser_context_);
433 event->restrict_to_browser_context = browser_context_;
434 433
435 router->DispatchEventToExtension(request->extension_id(), std::move(event)); 434 router->DispatchEventToExtension(request->extension_id(), std::move(event));
436 } 435 }
437 436
438 TabCaptureRegistry::LiveRequest* TabCaptureRegistry::FindRequest( 437 TabCaptureRegistry::LiveRequest* TabCaptureRegistry::FindRequest(
439 const content::WebContents* target_contents) const { 438 const content::WebContents* target_contents) const {
440 for (const auto& request : requests_) { 439 for (const auto& request : requests_) {
441 if (request->web_contents() == target_contents) 440 if (request->web_contents() == target_contents)
442 return request.get(); 441 return request.get();
443 } 442 }
(...skipping 19 matching lines...) Expand all
463 it != requests_.end(); ++it) { 462 it != requests_.end(); ++it) {
464 if (it->get() == request) { 463 if (it->get() == request) {
465 requests_.erase(it); 464 requests_.erase(it);
466 return; 465 return;
467 } 466 }
468 } 467 }
469 NOTREACHED(); 468 NOTREACHED();
470 } 469 }
471 470
472 } // namespace extensions 471 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698