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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_api.cc

Issue 2257113002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 04ab949662f5d87a105f5f0cbc09c0b1f13eb9e8..5a780124541b8fda0700ab5dc02cb1d602c62484 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -105,9 +105,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(new Event(
+ std::unique_ptr<Event> event = base::MakeUnique<Event>(
events::OMNIBOX_ON_INPUT_STARTED, omnibox::OnInputStarted::kEventName,
- base::WrapUnique(new base::ListValue())));
+ base::MakeUnique<base::ListValue>());
event->restrict_to_browser_context = profile;
EventRouter::Get(profile)
->DispatchEventToExtension(extension_id, std::move(event));
@@ -126,9 +126,9 @@ bool ExtensionOmniboxEventRouter::OnInputChanged(
args->Set(0, new base::StringValue(input));
args->Set(1, new base::FundamentalValue(suggest_id));
- std::unique_ptr<Event> event(new Event(events::OMNIBOX_ON_INPUT_CHANGED,
- omnibox::OnInputChanged::kEventName,
- std::move(args)));
+ 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;
event_router->DispatchEventToExtension(extension_id, std::move(event));
return true;
@@ -159,9 +159,9 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
else
args->Set(1, new base::StringValue(kCurrentTabDisposition));
- std::unique_ptr<Event> event(new Event(events::OMNIBOX_ON_INPUT_ENTERED,
- omnibox::OnInputEntered::kEventName,
- std::move(args)));
+ 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;
EventRouter::Get(profile)
->DispatchEventToExtension(extension_id, std::move(event));
@@ -175,9 +175,9 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
// static
void ExtensionOmniboxEventRouter::OnInputCancelled(
Profile* profile, const std::string& extension_id) {
- std::unique_ptr<Event> event(new Event(
+ std::unique_ptr<Event> event = base::MakeUnique<Event>(
events::OMNIBOX_ON_INPUT_CANCELLED, omnibox::OnInputCancelled::kEventName,
- base::WrapUnique(new base::ListValue())));
+ base::MakeUnique<base::ListValue>());
event->restrict_to_browser_context = profile;
EventRouter::Get(profile)
->DispatchEventToExtension(extension_id, std::move(event));

Powered by Google App Engine
This is Rietveld 408576698