OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 void ToggleWhenVisible(Profile* profile); | 186 void ToggleWhenVisible(Profile* profile); |
187 | 187 |
188 // Register user preferences for BookmarksBar. | 188 // Register user preferences for BookmarksBar. |
189 void RegisterUserPrefs(PrefService* prefs); | 189 void RegisterUserPrefs(PrefService* prefs); |
190 | 190 |
191 // Fills in the URL and title for a bookmark of |tab_contents|. | 191 // Fills in the URL and title for a bookmark of |tab_contents|. |
192 void GetURLAndTitleToBookmark(TabContents* tab_contents, | 192 void GetURLAndTitleToBookmark(TabContents* tab_contents, |
193 GURL* url, | 193 GURL* url, |
194 string16* title); | 194 string16* title); |
195 | 195 |
196 // Fills in the URL and title for a bookmark from the current tab of the active | |
sky
2011/07/07 17:11:46
active -> specified
sadrul
2011/07/07 17:33:28
Done.
| |
197 // profile. | |
198 void GetURLAndTitleToBookmarkFromCurrentTab(Profile* profile, | |
199 GURL* url, | |
200 string16* title); | |
201 | |
196 // Returns, by reference in |urls|, the url and title pairs for each open | 202 // Returns, by reference in |urls|, the url and title pairs for each open |
197 // tab in browser. | 203 // tab in browser. |
198 void GetURLsForOpenTabs(Browser* browser, | 204 void GetURLsForOpenTabs(Browser* browser, |
199 std::vector<std::pair<GURL, string16> >* urls); | 205 std::vector<std::pair<GURL, string16> >* urls); |
200 | 206 |
201 // Returns the parent for newly created folders/bookmarks. If |selection| has | 207 // Returns the parent for newly created folders/bookmarks. If |selection| has |
202 // one element and it is a folder, |selection[0]| is returned, otherwise | 208 // one element and it is a folder, |selection[0]| is returned, otherwise |
203 // |parent| is returned. If |index| is non-null it is set to the index newly | 209 // |parent| is returned. If |index| is non-null it is set to the index newly |
204 // added nodes should be added at. | 210 // added nodes should be added at. |
205 const BookmarkNode* GetParentForNewNodes( | 211 const BookmarkNode* GetParentForNewNodes( |
206 const BookmarkNode* parent, | 212 const BookmarkNode* parent, |
207 const std::vector<const BookmarkNode*>& selection, | 213 const std::vector<const BookmarkNode*>& selection, |
208 int* index); | 214 int* index); |
209 | 215 |
210 // Returns true if the specified node is of type URL, or has a descendant | 216 // Returns true if the specified node is of type URL, or has a descendant |
211 // of type URL. | 217 // of type URL. |
212 bool NodeHasURLs(const BookmarkNode* node); | 218 bool NodeHasURLs(const BookmarkNode* node); |
213 | 219 |
214 // Number of bookmarks we'll open before prompting the user to see if they | 220 // Number of bookmarks we'll open before prompting the user to see if they |
215 // really want to open all. | 221 // really want to open all. |
216 // | 222 // |
217 // NOTE: treat this as a const. It is not const as various tests change the | 223 // NOTE: treat this as a const. It is not const as various tests change the |
218 // value. | 224 // value. |
219 extern int num_urls_before_prompting; | 225 extern int num_urls_before_prompting; |
220 | 226 |
221 } // namespace bookmark_utils | 227 } // namespace bookmark_utils |
222 | 228 |
223 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 229 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
OLD | NEW |