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

Unified Diff: chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc

Issue 2336863003: Change more base::ListValue methods to use std::unique_ptr. (Closed)
Patch Set: . Created 4 years, 3 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/ui/webui/settings/settings_manage_profile_handler.cc
diff --git a/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc b/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc
index 99a709fdb2686700bd222bf9cc3ed0e3f4e40167..7d796d2d94a4946116621e69e99e9dc126692cfb 100644
--- a/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc
+++ b/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc
@@ -4,8 +4,11 @@
#include "chrome/browser/ui/webui/settings/settings_manage_profile_handler.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -107,14 +110,14 @@ std::unique_ptr<base::ListValue> ManageProfileHandler::GetAvailableIcons() {
GetProfileAttributesWithPath(profile_->GetPath(), &entry)) {
const gfx::Image* icon = entry->GetGAIAPicture();
if (icon) {
- base::DictionaryValue* gaia_picture_info = new base::DictionaryValue();
+ auto gaia_picture_info = base::MakeUnique<base::DictionaryValue>();
gfx::Image icon2 = profiles::GetAvatarIconForWebUI(*icon, true);
gaia_picture_url_ = webui::GetBitmapDataUrl(icon2.AsBitmap());
gaia_picture_info->SetString("url", gaia_picture_url_);
gaia_picture_info->SetString(
"label",
l10n_util::GetStringUTF16(IDS_SETTINGS_CHANGE_PICTURE_PROFILE_PHOTO));
- image_url_list->Insert(0, gaia_picture_info);
+ image_url_list->Insert(0, std::move(gaia_picture_info));
}
}

Powered by Google App Engine
This is Rietveld 408576698