| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // BookmarkCodec is responsible for encoding and decoding the BookmarkModel | 5 // BookmarkCodec is responsible for encoding and decoding the BookmarkModel |
| 6 // into JSON values. The encoded values are written to disk via the | 6 // into JSON values. The encoded values are written to disk via the |
| 7 // BookmarkService. | 7 // BookmarkService. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ | 9 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ |
| 10 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ | 10 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ |
| 11 | 11 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 BookmarkNode* parent); | 102 BookmarkNode* parent); |
| 103 | 103 |
| 104 // Reassigns bookmark IDs for all nodes. | 104 // Reassigns bookmark IDs for all nodes. |
| 105 void ReassignIDs(BookmarkNode* bb_node, BookmarkNode* other_node); | 105 void ReassignIDs(BookmarkNode* bb_node, BookmarkNode* other_node); |
| 106 | 106 |
| 107 // Helper to recursively reassign IDs. | 107 // Helper to recursively reassign IDs. |
| 108 void ReassignIDsHelper(BookmarkNode* node); | 108 void ReassignIDsHelper(BookmarkNode* node); |
| 109 | 109 |
| 110 // Decodes the supplied node from the supplied value. Child nodes are | 110 // Decodes the supplied node from the supplied value. Child nodes are |
| 111 // created appropriately by way of DecodeChildren. If node is NULL a new | 111 // created appropriately by way of DecodeChildren. If node is NULL a new |
| 112 // node is created and added to parent, otherwise node is used. | 112 // node is created and added to parent (parent must then be non-NULL), |
| 113 // otherwise node is used. |
| 113 bool DecodeNode(const DictionaryValue& value, | 114 bool DecodeNode(const DictionaryValue& value, |
| 114 BookmarkNode* parent, | 115 BookmarkNode* parent, |
| 115 BookmarkNode* node); | 116 BookmarkNode* node); |
| 116 | 117 |
| 117 // Updates the check-sum with the given string. | 118 // Updates the check-sum with the given string. |
| 118 void UpdateChecksum(const std::string& str); | 119 void UpdateChecksum(const std::string& str); |
| 119 void UpdateChecksum(const std::wstring& str); | 120 void UpdateChecksum(const std::wstring& str); |
| 120 | 121 |
| 121 // Updates the check-sum with the given contents of URL/folder bookmark node. | 122 // Updates the check-sum with the given contents of URL/folder bookmark node. |
| 122 // NOTE: These functions take in individual properties of a bookmark node | 123 // NOTE: These functions take in individual properties of a bookmark node |
| (...skipping 23 matching lines...) Expand all Loading... |
| 146 std::string computed_checksum_; | 147 std::string computed_checksum_; |
| 147 std::string stored_checksum_; | 148 std::string stored_checksum_; |
| 148 | 149 |
| 149 // Maximum ID assigned when decoding data. | 150 // Maximum ID assigned when decoding data. |
| 150 int64 maximum_id_; | 151 int64 maximum_id_; |
| 151 | 152 |
| 152 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec); | 153 DISALLOW_COPY_AND_ASSIGN(BookmarkCodec); |
| 153 }; | 154 }; |
| 154 | 155 |
| 155 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ | 156 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_CODEC_H_ |
| OLD | NEW |