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

Unified Diff: chrome/browser/undo/bookmark_undo_service.cc

Issue 242823002: Extract GetNodeByID() method from BookmarkModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert a change in bookmarks_helper.cc that colides with a wstring and cq does not like that Created 6 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/webui/ntp/android/bookmarks_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/undo/bookmark_undo_service.cc
diff --git a/chrome/browser/undo/bookmark_undo_service.cc b/chrome/browser/undo/bookmark_undo_service.cc
index 1c66faaaf56bd0bba38b62416c743f08289a0222..90bcd93135c3ecdb4bf446fe6bb6054bd2909b47 100644
--- a/chrome/browser/undo/bookmark_undo_service.cc
+++ b/chrome/browser/undo/bookmark_undo_service.cc
@@ -81,7 +81,7 @@ BookmarkAddOperation::BookmarkAddOperation(Profile* profile,
void BookmarkAddOperation::Undo() {
BookmarkModel* model = GetBookmarkModel();
- const BookmarkNode* parent = model->GetNodeByID(parent_id_);
+ const BookmarkNode* parent = GetBookmarkNodeByID(model, parent_id_);
DCHECK(parent);
model->Remove(parent, index_);
@@ -147,7 +147,7 @@ BookmarkRemoveOperation::BookmarkRemoveOperation(Profile* profile,
void BookmarkRemoveOperation::Undo() {
DCHECK(removed_node_.is_valid());
BookmarkModel* model = GetBookmarkModel();
- const BookmarkNode* parent = model->GetNodeByID(parent_id_);
+ const BookmarkNode* parent = GetBookmarkNodeByID(model, parent_id_);
DCHECK(parent);
bookmark_utils::CloneBookmarkNode(model, removed_node_.elements, parent,
@@ -215,7 +215,7 @@ BookmarkEditOperation::BookmarkEditOperation(Profile* profile,
void BookmarkEditOperation::Undo() {
DCHECK(original_bookmark_.is_valid());
BookmarkModel* model = GetBookmarkModel();
- const BookmarkNode* node = model->GetNodeByID(node_id_);
+ const BookmarkNode* node = GetBookmarkNodeByID(model, node_id_);
DCHECK(node);
model->SetTitle(node, original_bookmark_.elements[0].title);
@@ -279,8 +279,8 @@ BookmarkMoveOperation::BookmarkMoveOperation(Profile* profile,
void BookmarkMoveOperation::Undo() {
BookmarkModel* model = GetBookmarkModel();
- const BookmarkNode* old_parent = model->GetNodeByID(old_parent_id_);
- const BookmarkNode* new_parent = model->GetNodeByID(new_parent_id_);
+ const BookmarkNode* old_parent = GetBookmarkNodeByID(model, old_parent_id_);
+ const BookmarkNode* new_parent = GetBookmarkNodeByID(model, new_parent_id_);
DCHECK(old_parent);
DCHECK(new_parent);
@@ -352,12 +352,12 @@ BookmarkReorderOperation::~BookmarkReorderOperation() {
void BookmarkReorderOperation::Undo() {
BookmarkModel* model = GetBookmarkModel();
- const BookmarkNode* parent = model->GetNodeByID(parent_id_);
+ const BookmarkNode* parent = GetBookmarkNodeByID(model, parent_id_);
DCHECK(parent);
std::vector<const BookmarkNode*> ordered_nodes;
for (size_t i = 0; i < ordered_bookmarks_.size(); ++i)
- ordered_nodes.push_back(model->GetNodeByID(ordered_bookmarks_[i]));
+ ordered_nodes.push_back(GetBookmarkNodeByID(model, ordered_bookmarks_[i]));
model->ReorderChildren(parent, ordered_nodes);
}
« no previous file with comments | « chrome/browser/ui/webui/ntp/android/bookmarks_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698