| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/glue/bookmark_model_associator.h" | 5 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // folder Other Bookmarks in Chrome. | 44 // folder Other Bookmarks in Chrome. |
| 45 // | 45 // |
| 46 // It is the responsibility of something upstream (at time of writing, | 46 // It is the responsibility of something upstream (at time of writing, |
| 47 // the sync server) to create these tagged nodes when initializing sync | 47 // the sync server) to create these tagged nodes when initializing sync |
| 48 // for the first time for a user. Thus, once the backend finishes | 48 // for the first time for a user. Thus, once the backend finishes |
| 49 // initializing, the ProfileSyncService can rely on the presence of tagged | 49 // initializing, the ProfileSyncService can rely on the presence of tagged |
| 50 // nodes. | 50 // nodes. |
| 51 // | 51 // |
| 52 // TODO(ncarter): Pull these tags from an external protocol specification | 52 // TODO(ncarter): Pull these tags from an external protocol specification |
| 53 // rather than hardcoding them here. | 53 // rather than hardcoding them here. |
| 54 static const char kBookmarkBarTag[] = "bookmark_bar"; | 54 const char kBookmarkBarTag[] = "bookmark_bar"; |
| 55 static const char kMobileBookmarksTag[] = "synced_bookmarks"; | 55 const char kMobileBookmarksTag[] = "synced_bookmarks"; |
| 56 static const char kOtherBookmarksTag[] = "other_bookmarks"; | 56 const char kOtherBookmarksTag[] = "other_bookmarks"; |
| 57 static const char kServerError[] = | |
| 58 "Server did not create top-level nodes. Possibly we are running against " | |
| 59 "an out-of-date server?"; | |
| 60 | 57 |
| 61 // Bookmark comparer for map of bookmark nodes. | 58 // Bookmark comparer for map of bookmark nodes. |
| 62 class BookmarkComparer { | 59 class BookmarkComparer { |
| 63 public: | 60 public: |
| 64 // Compares the two given nodes and returns whether node1 should appear | 61 // Compares the two given nodes and returns whether node1 should appear |
| 65 // before node2 in strict weak ordering. | 62 // before node2 in strict weak ordering. |
| 66 bool operator()(const BookmarkNode* node1, | 63 bool operator()(const BookmarkNode* node1, |
| 67 const BookmarkNode* node2) const { | 64 const BookmarkNode* node2) const { |
| 68 DCHECK(node1); | 65 DCHECK(node1); |
| 69 DCHECK(node2); | 66 DCHECK(node2); |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 syncer::SyncError::PERSISTENCE_ERROR, | 739 syncer::SyncError::PERSISTENCE_ERROR, |
| 743 message, | 740 message, |
| 744 syncer::BOOKMARKS); | 741 syncer::BOOKMARKS); |
| 745 } | 742 } |
| 746 } | 743 } |
| 747 } | 744 } |
| 748 return syncer::SyncError(); | 745 return syncer::SyncError(); |
| 749 } | 746 } |
| 750 | 747 |
| 751 } // namespace browser_sync | 748 } // namespace browser_sync |
| OLD | NEW |