Chromium Code Reviews| Index: chrome/browser/history/starred_url_database.cc |
| diff --git a/chrome/browser/history/starred_url_database.cc b/chrome/browser/history/starred_url_database.cc |
| index 5336e07180f628468d3047c02493c3aa170a98fd..5845252b69be317f754dd3630faa781f7ff2a0fb 100644 |
| --- a/chrome/browser/history/starred_url_database.cc |
| +++ b/chrome/browser/history/starred_url_database.cc |
| @@ -24,7 +24,7 @@ |
| // id Unique identifier (primary key) for the entry. |
| // type Type of entry, if 0 this corresponds to a URL, 1 for |
| // a system folder, 2 for a user created folder, 3 for |
| -// other. |
| +// other, 4 for synced. |
|
sky
2011/05/17 15:59:08
This will never be in the database, so you can rem
Yaron
2011/05/17 19:17:33
Done.
|
| // url_id ID of the url, only valid if type == 0 |
| // group_id ID of the folder, only valid if type != 0. This id comes |
| // from the UI and is NOT the same as id. |
| @@ -66,6 +66,9 @@ void FillInStarredEntry(const sql::Statement& s, StarredEntry* entry) { |
| case 3: |
| entry->type = history::StarredEntry::OTHER; |
| break; |
| + case 4: |
| + entry->type = history::StarredEntry::SYNCED; |
|
sky
2011/05/17 15:59:08
Remove this.
Yaron
2011/05/17 19:17:33
Done.
|
| + break; |
| default: |
| NOTREACHED(); |
| break; |
| @@ -213,6 +216,9 @@ StarID StarredURLDatabase::CreateStarredEntryRow(URLID url_id, |
| case history::StarredEntry::OTHER: |
| statement.BindInt(0, 3); |
| break; |
| + case history::StarredEntry::SYNCED: |
|
sky
2011/05/17 15:59:08
Remove this.
Yaron
2011/05/17 19:17:33
Done.
|
| + statement.BindInt(0, 4); |
| + break; |
| default: |
| NOTREACHED(); |
| } |
| @@ -545,6 +551,12 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const FilePath& path) { |
| entry.type = history::StarredEntry::OTHER; |
| BookmarkNode other_node(0, GURL()); |
| other_node.Reset(entry); |
| + // NOTE(yfriedman): We don't do anything with the synced star node because it |
| + // won't ever exist in the starred node DB. We only need to create it to pass |
| + // to "encode". |
| + entry.type = history::StarredEntry::SYNCED; |
| + BookmarkNode synced_node(0, GURL()); |
| + synced_node.Reset(entry); |
| std::map<history::UIStarID, history::StarID> folder_id_to_id_map; |
| typedef std::map<history::StarID, BookmarkNode*> IDToNodeMap; |
| @@ -579,6 +591,7 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const FilePath& path) { |
| i != entries.end(); ++i) { |
| if (!i->parent_folder_id) { |
| DCHECK(i->type == history::StarredEntry::BOOKMARK_BAR || |
| + i->type == history::StarredEntry::SYNCED || |
| i->type == history::StarredEntry::OTHER); |
| // Only entries with no parent should be the bookmark bar and other |
| // bookmarks folders. |
| @@ -616,7 +629,7 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const FilePath& path) { |
| // Save to file. |
| BookmarkCodec encoder; |
| scoped_ptr<Value> encoded_bookmarks( |
| - encoder.Encode(&bookmark_bar_node, &other_node)); |
| + encoder.Encode(&bookmark_bar_node, &other_node, &synced_node)); |
| std::string content; |
| base::JSONWriter::Write(encoded_bookmarks.get(), true, &content); |