Index: chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc |
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc |
index b8e25efee8cd6f9e592b47ab42fca38ca27a7517..7bade19c8507f9fad539ebf4c41237ca095dcc28 100644 |
--- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc |
+++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc |
@@ -5,6 +5,7 @@ |
#include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h" |
#include "base/basictypes.h" |
+#include "base/command_line.h" |
#include "base/logging.h" |
#include "base/string_util.h" |
#include "base/utf_string_conversions.h" |
@@ -14,6 +15,7 @@ |
#include "chrome/browser/net/url_fixer_upper.h" |
#include "chrome/browser/prefs/pref_service.h" |
#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/chrome_switches.h" |
#include "chrome/common/pref_names.h" |
#include "googleurl/src/gurl.h" |
#include "grit/chromium_strings.h" |
@@ -485,9 +487,17 @@ BookmarkEditorView::EditorNode* BookmarkEditorView::CreateRootNode() { |
EditorNode* root_node = new EditorNode(std::wstring(), 0); |
const BookmarkNode* bb_root_node = bb_model_->root_node(); |
CreateNodes(bb_root_node, root_node); |
- DCHECK(root_node->child_count() == 2); |
- DCHECK(bb_root_node->GetChild(0)->type() == BookmarkNode::BOOKMARK_BAR); |
- DCHECK(bb_root_node->GetChild(1)->type() == BookmarkNode::OTHER_NODE); |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableSyncedBookmarksFolder)) { |
+ DCHECK(root_node->child_count() == 3); |
Yaron
2011/05/12 00:39:55
Are we concerned about the case of you going back
sky
2011/05/12 15:37:19
We generally show a warning to the user if they at
Yaron
2011/05/12 18:19:22
I see. Well, I changed it to allow 2-3 or nodes wh
|
+ DCHECK(bb_root_node->GetChild(0)->type() == BookmarkNode::BOOKMARK_BAR); |
+ DCHECK(bb_root_node->GetChild(1)->type() == BookmarkNode::OTHER_NODE); |
+ DCHECK(bb_root_node->GetChild(2)->type() == BookmarkNode::SYNCED); |
+ } else { |
+ DCHECK(root_node->child_count() == 2); |
+ DCHECK(bb_root_node->GetChild(0)->type() == BookmarkNode::BOOKMARK_BAR); |
+ DCHECK(bb_root_node->GetChild(1)->type() == BookmarkNode::OTHER_NODE); |
+ } |
return root_node; |
} |