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

Unified Diff: chrome/browser/ui/search_engines/template_url_table_model.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
Index: chrome/browser/ui/search_engines/template_url_table_model.cc
diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc
index ed72587c1a60da8ad8f1b87bf04a084343b6a609..d512e292520b4174f795df59494dd6ffcfab20f8 100644
--- a/chrome/browser/ui/search_engines/template_url_table_model.cc
+++ b/chrome/browser/ui/search_engines/template_url_table_model.cc
@@ -247,7 +247,7 @@ void TemplateURLTableModel::Remove(int index) {
template_url_service_->RemoveObserver(this);
TemplateURL* template_url = GetTemplateURL(index);
- scoped_ptr<ModelEntry> entry(RemoveEntry(index));
+ std::unique_ptr<ModelEntry> entry(RemoveEntry(index));
// Make sure to remove from the table model first, otherwise the
// TemplateURL would be freed.
@@ -268,7 +268,7 @@ void TemplateURLTableModel::Add(int index,
data.SetURL(url);
TemplateURL* turl = new TemplateURL(data);
template_url_service_->Add(turl);
- scoped_ptr<ModelEntry> entry(new ModelEntry(this, turl));
+ std::unique_ptr<ModelEntry> entry(new ModelEntry(this, turl));
template_url_service_->AddObserver(this);
AddEntry(index, std::move(entry));
}
@@ -317,7 +317,7 @@ int TemplateURLTableModel::MoveToMainGroup(int index) {
if (index < last_search_engine_index_)
return index; // Already in the main group.
- scoped_ptr<ModelEntry> current_entry(RemoveEntry(index));
+ std::unique_ptr<ModelEntry> current_entry(RemoveEntry(index));
const int new_index = last_search_engine_index_++;
AddEntry(new_index, std::move(current_entry));
return new_index;
@@ -373,9 +373,9 @@ void TemplateURLTableModel::OnTemplateURLServiceChanged() {
Reload();
}
-scoped_ptr<TemplateURLTableModel::ModelEntry>
+std::unique_ptr<TemplateURLTableModel::ModelEntry>
TemplateURLTableModel::RemoveEntry(int index) {
- scoped_ptr<ModelEntry> entry(entries_[index]);
+ std::unique_ptr<ModelEntry> entry(entries_[index]);
entries_.erase(index + entries_.begin());
if (index < last_search_engine_index_)
--last_search_engine_index_;
@@ -386,7 +386,8 @@ TemplateURLTableModel::RemoveEntry(int index) {
return entry;
}
-void TemplateURLTableModel::AddEntry(int index, scoped_ptr<ModelEntry> entry) {
+void TemplateURLTableModel::AddEntry(int index,
+ std::unique_ptr<ModelEntry> entry) {
entries_.insert(entries_.begin() + index, entry.release());
if (index <= last_other_engine_index_)
++last_other_engine_index_;
« no previous file with comments | « chrome/browser/ui/search_engines/template_url_table_model.h ('k') | chrome/browser/ui/startup/default_browser_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698