Index: chrome/browser/bookmarks/bookmark_model.cc |
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc |
index ae85f96c2a2a087c5f8e4dcd641dcc94568d28ae..ba504757f883f3700542e17d818b87926025a4f6 100644 |
--- a/chrome/browser/bookmarks/bookmark_model.cc |
+++ b/chrome/browser/bookmarks/bookmark_model.cc |
@@ -194,7 +194,8 @@ void BookmarkModel::EndImportMode() { |
} |
void BookmarkModel::Remove(const BookmarkNode* parent, int index) { |
- if (!loaded_ || !IsValidIndex(parent, index, false) || is_root(parent)) { |
+ if (!loaded_ || !IsValidIndex(parent, index, false) || |
+ parent == root_node()) { |
NOTREACHED(); |
return; |
} |
@@ -205,7 +206,7 @@ void BookmarkModel::Move(const BookmarkNode* node, |
const BookmarkNode* new_parent, |
int index) { |
if (!loaded_ || !node || !IsValidIndex(new_parent, index, true) || |
- is_root(new_parent) || is_permanent_node(node)) { |
+ new_parent == root_node() || is_permanent_node(node)) { |
NOTREACHED(); |
return; |
} |
@@ -244,7 +245,7 @@ void BookmarkModel::Copy(const BookmarkNode* node, |
const BookmarkNode* new_parent, |
int index) { |
if (!loaded_ || !node || !IsValidIndex(new_parent, index, true) || |
- is_root(new_parent) || is_permanent_node(node)) { |
+ new_parent == root_node() || is_permanent_node(node)) { |
NOTREACHED(); |
return; |
} |
@@ -400,7 +401,7 @@ const BookmarkNode* BookmarkModel::GetNodeByID(int64 id) { |
const BookmarkNode* BookmarkModel::AddFolder(const BookmarkNode* parent, |
int index, |
const string16& title) { |
- if (!loaded_ || parent == &root_ || !IsValidIndex(parent, index, true)) { |
+ if (!loaded_ || parent == root_node() || !IsValidIndex(parent, index, true)) { |
// Can't add to the root. |
NOTREACHED(); |
return NULL; |
@@ -427,7 +428,7 @@ const BookmarkNode* BookmarkModel::AddURLWithCreationTime( |
const string16& title, |
const GURL& url, |
const Time& creation_time) { |
- if (!loaded_ || !url.is_valid() || is_root(parent) || |
+ if (!loaded_ || !url.is_valid() || parent == root_node() || |
!IsValidIndex(parent, index, true)) { |
NOTREACHED(); |
return NULL; |
@@ -452,7 +453,7 @@ const BookmarkNode* BookmarkModel::AddURLWithCreationTime( |
} |
void BookmarkModel::SortChildren(const BookmarkNode* parent) { |
- if (!parent || !parent->is_folder() || is_root(parent) || |
+ if (!parent || !parent->is_folder() || parent == root_node() || |
parent->child_count() <= 1) { |
return; |
} |
@@ -832,5 +833,5 @@ BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() { |
BookmarkNode* other_node = CreatePermanentNode(BookmarkNode::OTHER_NODE); |
BookmarkNode* synced_node = CreatePermanentNode(BookmarkNode::SYNCED); |
return new BookmarkLoadDetails(bb_node, other_node, synced_node, |
- new BookmarkIndex(profile()), next_node_id_); |
+ new BookmarkIndex(profile_), next_node_id_); |
} |