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

Unified Diff: chrome/browser/ui/app_list/app_list_prefs.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
« no previous file with comments | « chrome/browser/ui/app_list/app_list_prefs.h ('k') | chrome/browser/ui/app_list/app_list_prefs_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/app_list_prefs.cc
diff --git a/chrome/browser/ui/app_list/app_list_prefs.cc b/chrome/browser/ui/app_list/app_list_prefs.cc
index a4dac1a262bd148497bc09f57187656907e97dae..27abd53b9cb66d6e18beadebfac297172d04157d 100644
--- a/chrome/browser/ui/app_list/app_list_prefs.cc
+++ b/chrome/browser/ui/app_list/app_list_prefs.cc
@@ -32,9 +32,9 @@ AppListPrefs::AppListInfo::AppListInfo(const AppListInfo& other) = default;
AppListPrefs::AppListInfo::~AppListInfo() {
}
-scoped_ptr<base::DictionaryValue>
+std::unique_ptr<base::DictionaryValue>
AppListPrefs::AppListInfo::CreateDictFromAppListInfo() const {
- scoped_ptr<base::DictionaryValue> item_dict(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> item_dict(new base::DictionaryValue());
item_dict->SetString(kModelItemPosition, position.ToInternalValue());
item_dict->SetString(kModelItemParentId, parent_id);
item_dict->SetString(kModelItemName, name);
@@ -43,11 +43,11 @@ AppListPrefs::AppListInfo::CreateDictFromAppListInfo() const {
}
// static
-scoped_ptr<AppListPrefs::AppListInfo>
+std::unique_ptr<AppListPrefs::AppListInfo>
AppListPrefs::AppListInfo::CreateAppListInfoFromDict(
const base::DictionaryValue* item_dict) {
std::string item_ordinal_string;
- scoped_ptr<AppListInfo> info(new AppListPrefs::AppListInfo());
+ std::unique_ptr<AppListInfo> info(new AppListPrefs::AppListInfo());
int item_type_int = -1;
if (!item_dict ||
!item_dict->GetString(kModelItemPosition, &item_ordinal_string) ||
@@ -55,7 +55,7 @@ AppListPrefs::AppListInfo::CreateAppListInfoFromDict(
!item_dict->GetString(kModelItemName, &info->name) ||
!item_dict->GetInteger(kModelItemType, &item_type_int) ||
item_type_int < ITEM_TYPE_BEGIN || item_type_int > ITEM_TYPE_END) {
- return scoped_ptr<AppListInfo>();
+ return std::unique_ptr<AppListInfo>();
}
info->position = syncer::StringOrdinal(item_ordinal_string);
@@ -94,14 +94,14 @@ void AppListPrefs::SetAppListInfo(const std::string& id,
update->Set(id, info.CreateDictFromAppListInfo().release());
}
-scoped_ptr<AppListPrefs::AppListInfo> AppListPrefs::GetAppListInfo(
+std::unique_ptr<AppListPrefs::AppListInfo> AppListPrefs::GetAppListInfo(
const std::string& id) const {
const base::DictionaryValue* model_dict =
pref_service_->GetDictionary(kPrefModel);
DCHECK(model_dict);
const base::DictionaryValue* item_dict = NULL;
if (!model_dict->GetDictionary(id, &item_dict))
- return scoped_ptr<AppListInfo>();
+ return std::unique_ptr<AppListInfo>();
return AppListInfo::CreateAppListInfoFromDict(item_dict);
}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_prefs.h ('k') | chrome/browser/ui/app_list/app_list_prefs_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698