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

Side by Side Diff: chrome/browser/extensions/event_router_forwarder.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/event_router_forwarder.h" 5 #include "chrome/browser/extensions/event_router_forwarder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 Profile* restrict_to_profile, 125 Profile* restrict_to_profile,
126 const GURL& event_url) { 126 const GURL& event_url) {
127 #if defined(OS_CHROMEOS) 127 #if defined(OS_CHROMEOS)
128 // Extension does not exist for chromeos login. This needs to be 128 // Extension does not exist for chromeos login. This needs to be
129 // removed once we have an extension service for login screen. 129 // removed once we have an extension service for login screen.
130 // crosbug.com/12856. 130 // crosbug.com/12856.
131 if (!extensions::EventRouter::Get(profile)) 131 if (!extensions::EventRouter::Get(profile))
132 return; 132 return;
133 #endif 133 #endif
134 134
135 std::unique_ptr<Event> event( 135 auto event = base::MakeUnique<Event>(
136 new Event(histogram_value, event_name, std::move(event_args))); 136 histogram_value, event_name, std::move(event_args), restrict_to_profile);
137 event->restrict_to_browser_context = restrict_to_profile;
138 event->event_url = event_url; 137 event->event_url = event_url;
139 if (extension_id.empty()) { 138 if (extension_id.empty()) {
140 extensions::EventRouter::Get(profile)->BroadcastEvent(std::move(event)); 139 extensions::EventRouter::Get(profile)->BroadcastEvent(std::move(event));
141 } else { 140 } else {
142 extensions::EventRouter::Get(profile) 141 extensions::EventRouter::Get(profile)
143 ->DispatchEventToExtension(extension_id, std::move(event)); 142 ->DispatchEventToExtension(extension_id, std::move(event));
144 } 143 }
145 } 144 }
146 145
147 } // namespace extensions 146 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698