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

Unified Diff: extensions/browser/api/app_runtime/app_runtime_api.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/chrome_keyboard_ui.cc ('k') | extensions/browser/api/idle/idle_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/app_runtime/app_runtime_api.cc
diff --git a/extensions/browser/api/app_runtime/app_runtime_api.cc b/extensions/browser/api/app_runtime/app_runtime_api.cc
index 63c73a8fd2c22c4ba7b549e56bca54c5c86403a4..b1093686210de1bdd487efd5403b9f44a81ea4d4 100644
--- a/extensions/browser/api/app_runtime/app_runtime_api.cc
+++ b/extensions/browser/api/app_runtime/app_runtime_api.cc
@@ -36,10 +36,9 @@ void DispatchOnEmbedRequestedEventImpl(
content::BrowserContext* context) {
std::unique_ptr<base::ListValue> args(new base::ListValue());
args->Append(std::move(app_embedding_request_data));
- std::unique_ptr<Event> event(
- new Event(events::APP_RUNTIME_ON_EMBED_REQUESTED,
- app_runtime::OnEmbedRequested::kEventName, std::move(args)));
- event->restrict_to_browser_context = context;
+ auto event = base::MakeUnique<Event>(
+ events::APP_RUNTIME_ON_EMBED_REQUESTED,
+ app_runtime::OnEmbedRequested::kEventName, std::move(args), context);
EventRouter::Get(context)
->DispatchEventWithLazyListener(extension_id, std::move(event));
@@ -66,10 +65,9 @@ void DispatchOnLaunchedEventImpl(
std::unique_ptr<base::ListValue> args(new base::ListValue());
args->Append(std::move(launch_data));
- std::unique_ptr<Event> event(new Event(events::APP_RUNTIME_ON_LAUNCHED,
- app_runtime::OnLaunched::kEventName,
- std::move(args)));
- event->restrict_to_browser_context = context;
+ auto event = base::MakeUnique<Event>(events::APP_RUNTIME_ON_LAUNCHED,
+ app_runtime::OnLaunched::kEventName,
+ std::move(args), context);
EventRouter::Get(context)
->DispatchEventWithLazyListener(extension_id, std::move(event));
ExtensionPrefs::Get(context)
@@ -147,10 +145,9 @@ void AppRuntimeEventRouter::DispatchOnRestartedEvent(
BrowserContext* context,
const Extension* extension) {
std::unique_ptr<base::ListValue> arguments(new base::ListValue());
- std::unique_ptr<Event> event(new Event(events::APP_RUNTIME_ON_RESTARTED,
- app_runtime::OnRestarted::kEventName,
- std::move(arguments)));
- event->restrict_to_browser_context = context;
+ auto event = base::MakeUnique<Event>(events::APP_RUNTIME_ON_RESTARTED,
+ app_runtime::OnRestarted::kEventName,
+ std::move(arguments), context);
EventRouter::Get(context)
->DispatchEventToExtension(extension->id(), std::move(event));
}
« no previous file with comments | « chrome/browser/ui/ash/chrome_keyboard_ui.cc ('k') | extensions/browser/api/idle/idle_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698