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_BOOKMARKS_BOOKMARK_UTILS_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 size_t count, | 60 size_t count, |
61 std::vector<const BookmarkNode*>* nodes); | 61 std::vector<const BookmarkNode*>* nodes); |
62 | 62 |
63 // Returns true if |n1| was added more recently than |n2|. | 63 // Returns true if |n1| was added more recently than |n2|. |
64 bool MoreRecentlyAdded(const BookmarkNode* n1, const BookmarkNode* n2); | 64 bool MoreRecentlyAdded(const BookmarkNode* n1, const BookmarkNode* n2); |
65 | 65 |
66 // Returns up to |max_count| bookmarks from |model| whose url or title contains | 66 // Returns up to |max_count| bookmarks from |model| whose url or title contains |
67 // the text |text|. |languages| is user's accept-language setting to decode | 67 // the text |text|. |languages| is user's accept-language setting to decode |
68 // IDN. | 68 // IDN. |
69 void GetBookmarksContainingText(BookmarkModel* model, | 69 void GetBookmarksContainingText(BookmarkModel* model, |
70 const string16& text, | 70 const base::string16& text, |
71 size_t max_count, | 71 size_t max_count, |
72 const std::string& languages, | 72 const std::string& languages, |
73 std::vector<const BookmarkNode*>* nodes); | 73 std::vector<const BookmarkNode*>* nodes); |
74 | 74 |
75 // Register user preferences for Bookmarks Bar. | 75 // Register user preferences for Bookmarks Bar. |
76 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 76 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
77 | 77 |
78 // Returns the parent for newly created folders/bookmarks. If |selection| has | 78 // Returns the parent for newly created folders/bookmarks. If |selection| has |
79 // one element and it is a folder, |selection[0]| is returned, otherwise | 79 // one element and it is a folder, |selection[0]| is returned, otherwise |
80 // |parent| is returned. If |index| is non-null it is set to the index newly | 80 // |parent| is returned. If |index| is non-null it is set to the index newly |
81 // added nodes should be added at. | 81 // added nodes should be added at. |
82 const BookmarkNode* GetParentForNewNodes( | 82 const BookmarkNode* GetParentForNewNodes( |
83 const BookmarkNode* parent, | 83 const BookmarkNode* parent, |
84 const std::vector<const BookmarkNode*>& selection, | 84 const std::vector<const BookmarkNode*>& selection, |
85 int* index); | 85 int* index); |
86 | 86 |
87 // Deletes the bookmark folders for the given list of |ids|. | 87 // Deletes the bookmark folders for the given list of |ids|. |
88 void DeleteBookmarkFolders(BookmarkModel* model, const std::vector<int64>& ids); | 88 void DeleteBookmarkFolders(BookmarkModel* model, const std::vector<int64>& ids); |
89 | 89 |
90 // If there are no bookmarks for url, a bookmark is created. | 90 // If there are no bookmarks for url, a bookmark is created. |
91 void AddIfNotBookmarked(BookmarkModel* model, | 91 void AddIfNotBookmarked(BookmarkModel* model, |
92 const GURL& url, | 92 const GURL& url, |
93 const string16& title); | 93 const base::string16& title); |
94 | 94 |
95 // Removes all bookmarks for the given |url|. | 95 // Removes all bookmarks for the given |url|. |
96 void RemoveAllBookmarks(BookmarkModel* model, const GURL& url); | 96 void RemoveAllBookmarks(BookmarkModel* model, const GURL& url); |
97 | 97 |
98 } // namespace bookmark_utils | 98 } // namespace bookmark_utils |
99 | 99 |
100 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 100 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
OLD | NEW |