OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #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 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 int index); | 86 int index); |
87 | 87 |
88 // Sets the favicon of the given bookmark node from the given sync node. | 88 // Sets the favicon of the given bookmark node from the given sync node. |
89 // Returns whether the favicon was set in the bookmark node. | 89 // Returns whether the favicon was set in the bookmark node. |
90 // |profile| is the profile that contains the HistoryService and BookmarkModel | 90 // |profile| is the profile that contains the HistoryService and BookmarkModel |
91 // for the bookmark in question. | 91 // for the bookmark in question. |
92 static bool SetBookmarkFavicon(syncer::BaseNode* sync_node, | 92 static bool SetBookmarkFavicon(syncer::BaseNode* sync_node, |
93 const BookmarkNode* bookmark_node, | 93 const BookmarkNode* bookmark_node, |
94 BookmarkModel* model); | 94 BookmarkModel* model); |
95 | 95 |
96 // Applies the favicon 1x |bitmap_data| to |bookmark_node|. | 96 // Applies the 1x favicon |bitmap_data| and |icon_url| to |bookmark_node|. |
97 // |profile| is the profile that contains the HistoryService and BookmarkModel | 97 // |profile| is the profile that contains the HistoryService and BookmarkModel |
98 // for the bookmark in question. | 98 // for the bookmark in question. |
99 static void ApplyBookmarkFavicon( | 99 static void ApplyBookmarkFavicon( |
100 const BookmarkNode* bookmark_node, | 100 const BookmarkNode* bookmark_node, |
101 Profile* profile, | 101 Profile* profile, |
| 102 const GURL& icon_url, |
102 const scoped_refptr<base::RefCountedMemory>& bitmap_data); | 103 const scoped_refptr<base::RefCountedMemory>& bitmap_data); |
103 | 104 |
104 // Sets the favicon of the given sync node from the given bookmark node. | 105 // Sets the favicon of the given sync node from the given bookmark node. |
105 static void SetSyncNodeFavicon(const BookmarkNode* bookmark_node, | 106 static void SetSyncNodeFavicon(const BookmarkNode* bookmark_node, |
106 BookmarkModel* model, | 107 BookmarkModel* model, |
107 syncer::WriteNode* sync_node); | 108 syncer::WriteNode* sync_node); |
108 | 109 |
109 // Treat the |index|th child of |parent| as a newly added node, and create a | 110 // Treat the |index|th child of |parent| as a newly added node, and create a |
110 // corresponding node in the sync domain using |trans|. All properties | 111 // corresponding node in the sync domain using |trans|. All properties |
111 // will be transferred to the new node. A node corresponding to |parent| | 112 // will be transferred to the new node. A node corresponding to |parent| |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 184 |
184 // The two models should be associated according to this ModelAssociator. | 185 // The two models should be associated according to this ModelAssociator. |
185 BookmarkModelAssociator* model_associator_; | 186 BookmarkModelAssociator* model_associator_; |
186 | 187 |
187 DISALLOW_COPY_AND_ASSIGN(BookmarkChangeProcessor); | 188 DISALLOW_COPY_AND_ASSIGN(BookmarkChangeProcessor); |
188 }; | 189 }; |
189 | 190 |
190 } // namespace browser_sync | 191 } // namespace browser_sync |
191 | 192 |
192 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ | 193 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_CHANGE_PROCESSOR_H_ |
OLD | NEW |