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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc

Issue 7012005: Revert "Revert 84829 - Initial implementation of "Synced Bookmarks" folder." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed 82349 as well Created 9 years, 7 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/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;
}

Powered by Google App Engine
This is Rietveld 408576698