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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_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
Index: chrome/browser/extensions/api/omnibox/omnibox_api.cc
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
index 44812570bba2e65af802e92f54091c47c0369900..2d9854e29ab01c16208e8074d6980d09d5bb515d 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -96,10 +96,9 @@ std::string GetTemplateURLStringForExtension(const std::string& extension_id) {
// static
void ExtensionOmniboxEventRouter::OnInputStarted(
Profile* profile, const std::string& extension_id) {
- std::unique_ptr<Event> event = base::MakeUnique<Event>(
+ auto event = base::MakeUnique<Event>(
events::OMNIBOX_ON_INPUT_STARTED, omnibox::OnInputStarted::kEventName,
- base::MakeUnique<base::ListValue>());
- event->restrict_to_browser_context = profile;
+ base::MakeUnique<base::ListValue>(), profile);
EventRouter::Get(profile)
->DispatchEventToExtension(extension_id, std::move(event));
}
@@ -117,10 +116,9 @@ bool ExtensionOmniboxEventRouter::OnInputChanged(
args->Set(0, base::MakeUnique<base::Value>(input));
args->Set(1, base::MakeUnique<base::Value>(suggest_id));
- std::unique_ptr<Event> event = base::MakeUnique<Event>(
- events::OMNIBOX_ON_INPUT_CHANGED, omnibox::OnInputChanged::kEventName,
- std::move(args));
- event->restrict_to_browser_context = profile;
+ auto event = base::MakeUnique<Event>(events::OMNIBOX_ON_INPUT_CHANGED,
+ omnibox::OnInputChanged::kEventName,
+ std::move(args), profile);
event_router->DispatchEventToExtension(extension_id, std::move(event));
return true;
}
@@ -150,10 +148,9 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
else
args->Set(1, base::MakeUnique<base::Value>(kCurrentTabDisposition));
- std::unique_ptr<Event> event = base::MakeUnique<Event>(
- events::OMNIBOX_ON_INPUT_ENTERED, omnibox::OnInputEntered::kEventName,
- std::move(args));
- event->restrict_to_browser_context = profile;
+ auto event = base::MakeUnique<Event>(events::OMNIBOX_ON_INPUT_ENTERED,
+ omnibox::OnInputEntered::kEventName,
+ std::move(args), profile);
EventRouter::Get(profile)
->DispatchEventToExtension(extension_id, std::move(event));
@@ -166,10 +163,9 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
// static
void ExtensionOmniboxEventRouter::OnInputCancelled(
Profile* profile, const std::string& extension_id) {
- std::unique_ptr<Event> event = base::MakeUnique<Event>(
+ auto event = base::MakeUnique<Event>(
events::OMNIBOX_ON_INPUT_CANCELLED, omnibox::OnInputCancelled::kEventName,
- base::MakeUnique<base::ListValue>());
- event->restrict_to_browser_context = profile;
+ base::MakeUnique<base::ListValue>(), profile);
EventRouter::Get(profile)
->DispatchEventToExtension(extension_id, std::move(event));
}
« no previous file with comments | « chrome/browser/extensions/api/mdns/mdns_api.cc ('k') | chrome/browser/extensions/api/preference/preference_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698