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

Unified Diff: chrome/browser/chromeos/extensions/first_run_private_api.cc

Issue 1991083002: Remove ExtensionFunction::SetResult(T*) overload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU Created 4 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/chromeos/extensions/first_run_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/first_run_private_api.cc b/chrome/browser/chromeos/extensions/first_run_private_api.cc
index 46c360ac47e34747315e4ea09a05ce79268ba439..98a6e00b9ccb63eb73605eaac6d280c6e476f590 100644
--- a/chrome/browser/chromeos/extensions/first_run_private_api.cc
+++ b/chrome/browser/chromeos/extensions/first_run_private_api.cc
@@ -4,6 +4,9 @@
#include "chrome/browser/chromeos/extensions/first_run_private_api.h"
+#include <memory>
+#include <utility>
+
#include "base/metrics/histogram.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/first_run/first_run.h"
@@ -18,7 +21,8 @@
bool FirstRunPrivateGetLocalizedStringsFunction::RunSync() {
UMA_HISTOGRAM_COUNTS("CrosFirstRun.DialogShown", 1);
- base::DictionaryValue* localized_strings = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> localized_strings(
+ new base::DictionaryValue());
const user_manager::User* user =
chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile());
if (!user->GetGivenName().empty()) {
@@ -49,9 +53,9 @@ bool FirstRunPrivateGetLocalizedStringsFunction::RunSync() {
l10n_util::GetStringUTF16(IDS_CLOSE));
const std::string& app_locale = g_browser_process->GetApplicationLocale();
- webui::SetLoadTimeDataDefaults(app_locale, localized_strings);
+ webui::SetLoadTimeDataDefaults(app_locale, localized_strings.get());
- SetResult(localized_strings);
+ SetResult(std::move(localized_strings));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698