| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 int index); | 70 int index); |
| 71 | 71 |
| 72 // Sets the favicon of the given bookmark node from the given sync node. | 72 // Sets the favicon of the given bookmark node from the given sync node. |
| 73 // Returns whether the favicon was set in the bookmark node. | 73 // Returns whether the favicon was set in the bookmark node. |
| 74 // |profile| is the profile that contains the HistoryService and BookmarkModel | 74 // |profile| is the profile that contains the HistoryService and BookmarkModel |
| 75 // for the bookmark in question. | 75 // for the bookmark in question. |
| 76 static bool SetBookmarkFavicon(sync_api::BaseNode* sync_node, | 76 static bool SetBookmarkFavicon(sync_api::BaseNode* sync_node, |
| 77 const BookmarkNode* bookmark_node, | 77 const BookmarkNode* bookmark_node, |
| 78 Profile* profile); | 78 Profile* profile); |
| 79 | 79 |
| 80 // Applies the favicon data in |icon_bytes_vector| to |bookmark_node|. |
| 81 // |profile| is the profile that contains the HistoryService and BookmarkModel |
| 82 // for the bookmark in question. |
| 83 static void ApplyBookmarkFavicon( |
| 84 const BookmarkNode* bookmark_node, |
| 85 Profile* profile, |
| 86 const std::vector<unsigned char>& icon_bytes_vector); |
| 87 |
| 80 // Sets the favicon of the given sync node from the given bookmark node. | 88 // Sets the favicon of the given sync node from the given bookmark node. |
| 81 static void SetSyncNodeFavicon(const BookmarkNode* bookmark_node, | 89 static void SetSyncNodeFavicon(const BookmarkNode* bookmark_node, |
| 82 BookmarkModel* model, | 90 BookmarkModel* model, |
| 83 sync_api::WriteNode* sync_node); | 91 sync_api::WriteNode* sync_node); |
| 84 | 92 |
| 85 // Treat the |index|th child of |parent| as a newly added node, and create a | 93 // Treat the |index|th child of |parent| as a newly added node, and create a |
| 86 // corresponding node in the sync domain using |trans|. All properties | 94 // corresponding node in the sync domain using |trans|. All properties |
| 87 // will be transferred to the new node. A node corresponding to |parent| | 95 // will be transferred to the new node. A node corresponding to |parent| |
| 88 // must already exist and be associated for this call to succeed. Returns | 96 // must already exist and be associated for this call to succeed. Returns |
| 89 // the ID of the just-created node, or if creation fails, kInvalidID. | 97 // the ID of the just-created node, or if creation fails, kInvalidID. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 167 |
| 160 // The two models should be associated according to this ModelAssociator. | 168 // The two models should be associated according to this ModelAssociator. |
| 161 BookmarkModelAssociator* model_associator_; | 169 BookmarkModelAssociator* model_associator_; |
| 162 | 170 |
| 163 DISALLOW_COPY_AND_ASSIGN(BookmarkChangeProcessor); | 171 DISALLOW_COPY_AND_ASSIGN(BookmarkChangeProcessor); |
| 164 }; | 172 }; |
| 165 | 173 |
| 166 } // namespace browser_sync | 174 } // namespace browser_sync |
| 167 | 175 |
| 168 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ | 176 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ |
| OLD | NEW |