| 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 b37d22d9832384b37e9256c310e672a31f27e43c..259eae90914d7475587b9c152cda515079a9a61f 100644
|
| --- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
|
| +++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
|
| @@ -74,7 +74,9 @@ bool SetOmniboxDefaultSuggestion(
|
| std::unique_ptr<base::DictionaryValue> dict = suggestion.ToValue();
|
| // Add the content field so that the dictionary can be used to populate an
|
| // omnibox::SuggestResult.
|
| - dict->SetWithoutPathExpansion(kSuggestionContent, new base::Value(""));
|
| + dict->SetWithoutPathExpansion(
|
| + kSuggestionContent,
|
| + base::MakeUnique<base::Value>(base::Value::Type::STRING));
|
| prefs->UpdateExtensionPref(extension_id, kOmniboxDefaultSuggestion,
|
| std::move(dict));
|
|
|
| @@ -111,8 +113,8 @@ bool ExtensionOmniboxEventRouter::OnInputChanged(
|
| return false;
|
|
|
| std::unique_ptr<base::ListValue> args(new base::ListValue());
|
| - args->Set(0, new base::Value(input));
|
| - args->Set(1, new base::Value(suggest_id));
|
| + 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,
|
| @@ -139,13 +141,13 @@ void ExtensionOmniboxEventRouter::OnInputEntered(
|
| active_tab_permission_granter()->GrantIfRequested(extension);
|
|
|
| std::unique_ptr<base::ListValue> args(new base::ListValue());
|
| - args->Set(0, new base::Value(input));
|
| + args->Set(0, base::MakeUnique<base::Value>(input));
|
| if (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB)
|
| - args->Set(1, new base::Value(kForegroundTabDisposition));
|
| + args->Set(1, base::MakeUnique<base::Value>(kForegroundTabDisposition));
|
| else if (disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB)
|
| - args->Set(1, new base::Value(kBackgroundTabDisposition));
|
| + args->Set(1, base::MakeUnique<base::Value>(kBackgroundTabDisposition));
|
| else
|
| - args->Set(1, new base::Value(kCurrentTabDisposition));
|
| + args->Set(1, base::MakeUnique<base::Value>(kCurrentTabDisposition));
|
|
|
| std::unique_ptr<Event> event = base::MakeUnique<Event>(
|
| events::OMNIBOX_ON_INPUT_ENTERED, omnibox::OnInputEntered::kEventName,
|
|
|