Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc |
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc |
index b6b522a6821c98ef927d673b6188e436f06f977a..488ace929ebf7eb5f3bff0869bc0c9251d81a700 100644 |
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc |
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc |
@@ -6,8 +6,6 @@ |
#include <stddef.h> |
-#include <string> |
-#include <utility> |
#include <vector> |
#include "apps/metrics_names.h" |
@@ -16,7 +14,6 @@ |
#include "base/bind_helpers.h" |
#include "base/command_line.h" |
#include "base/i18n/rtl.h" |
-#include "base/memory/ptr_util.h" |
#include "base/metrics/field_trial.h" |
#include "base/metrics/histogram_macros.h" |
#include "base/strings/string_util.h" |
@@ -362,7 +359,7 @@ |
// CreateAppInfo and ClearOrdinals can change the extension prefs. |
base::AutoReset<bool> auto_reset(&ignore_changes_, true); |
- auto installed_extensions = base::MakeUnique<base::ListValue>(); |
+ base::ListValue* list = new base::ListValue(); |
Profile* profile = Profile::FromWebUI(web_ui()); |
PrefService* prefs = profile->GetPrefs(); |
@@ -371,23 +368,24 @@ |
const Extension* extension = extension_service_->GetInstalledExtension(*it); |
if (extension && extensions::ui_util::ShouldDisplayInNewTabPage( |
extension, profile)) { |
- installed_extensions->Append(GetAppInfo(extension)); |
- } |
- } |
- |
- dictionary->Set("apps", std::move(installed_extensions)); |
+ list->Append(GetAppInfo(extension)); |
+ } |
+ } |
+ |
+ dictionary->Set("apps", list); |
const base::ListValue* app_page_names = |
prefs->GetList(prefs::kNtpAppPageNames); |
if (!app_page_names || !app_page_names->GetSize()) { |
ListPrefUpdate update(prefs, prefs::kNtpAppPageNames); |
base::ListValue* list = update.Get(); |
- list->Set(0, base::MakeUnique<base::Value>( |
+ list->Set(0, new base::Value( |
l10n_util::GetStringUTF16(IDS_APP_DEFAULT_PAGE_NAME))); |
- dictionary->Set("appPageNames", base::MakeUnique<base::Value>(*list)); |
+ dictionary->Set("appPageNames", |
+ static_cast<base::ListValue*>(list->DeepCopy())); |
} else { |
dictionary->Set("appPageNames", |
- base::MakeUnique<base::Value>(*app_page_names)); |
+ static_cast<base::ListValue*>(app_page_names->DeepCopy())); |
} |
} |
@@ -683,7 +681,7 @@ |
} |
void AppLauncherHandler::HandleSaveAppPageName(const base::ListValue* args) { |
- std::string name; |
+ base::string16 name; |
CHECK(args->GetString(0, &name)); |
double page_index; |
@@ -693,8 +691,7 @@ |
PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
ListPrefUpdate update(prefs, prefs::kNtpAppPageNames); |
base::ListValue* list = update.Get(); |
- list->Set(static_cast<size_t>(page_index), |
- base::MakeUnique<base::Value>(name)); |
+ list->Set(static_cast<size_t>(page_index), new base::Value(name)); |
} |
void AppLauncherHandler::HandleGenerateAppForLink(const base::ListValue* args) { |