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

Unified Diff: ui/views/controls/textfield/textfield_model.h

Issue 2314833002: Remove some uses of stl_util's STLDeleteContainerPointers. (Closed)
Patch Set: remove more 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: ui/views/controls/textfield/textfield_model.h
diff --git a/ui/views/controls/textfield/textfield_model.h b/ui/views/controls/textfield/textfield_model.h
index c66fe6d068083ee7047790207da919042160e663..58fdca3586d7bae1efce19b9ddd9bc08ba6450a6 100644
--- a/ui/views/controls/textfield/textfield_model.h
+++ b/ui/views/controls/textfield/textfield_model.h
@@ -265,9 +265,10 @@ class VIEWS_EXPORT TextfieldModel {
size_t new_text_start);
void ExecuteAndRecordInsert(const base::string16& new_text, bool mergeable);
- // Adds or merge |edit| into edit history. Return true if the edit
- // has been merged and must be deleted after redo.
- bool AddOrMergeEditHistory(internal::Edit* edit);
+ // Adds or merge |edit| into edit history. Return ownership of the edit if the
+ // edit has been merged and must be deleted after redo.
+ std::unique_ptr<internal::Edit> AddOrMergeEditHistory(
+ std::unique_ptr<internal::Edit> edit);
// Modify the text buffer in following way:
// 1) Delete the string from |delete_from| to |delte_to|.
@@ -294,7 +295,7 @@ class VIEWS_EXPORT TextfieldModel {
// The composition range.
gfx::Range composition_range_;
- typedef std::list<internal::Edit*> EditHistory;
+ typedef std::list<std::unique_ptr<internal::Edit>> EditHistory;
EditHistory edit_history_;
// An iterator that points to the current edit that can be undone.

Powered by Google App Engine
This is Rietveld 408576698