| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 const std::wstring& text, | 148 const std::wstring& text, |
| 149 const std::wstring& languages); | 149 const std::wstring& languages); |
| 150 | 150 |
| 151 // Modifies a bookmark node (assuming that there's no magic that needs to be | 151 // Modifies a bookmark node (assuming that there's no magic that needs to be |
| 152 // done regarding moving from one folder to another). If the URL changed or a | 152 // done regarding moving from one folder to another). If the URL changed or a |
| 153 // new node is explicitly being added, returns a pointer to the new node that | 153 // new node is explicitly being added, returns a pointer to the new node that |
| 154 // was created. Otherwise the return value is identically |node|. | 154 // was created. Otherwise the return value is identically |node|. |
| 155 const BookmarkNode* ApplyEditsWithNoGroupChange( | 155 const BookmarkNode* ApplyEditsWithNoGroupChange( |
| 156 BookmarkModel* model, | 156 BookmarkModel* model, |
| 157 const BookmarkNode* parent, | 157 const BookmarkNode* parent, |
| 158 const BookmarkNode* node, | 158 const BookmarkEditor::EditDetails& details, |
| 159 const std::wstring& new_title, | 159 const std::wstring& new_title, |
| 160 const GURL& new_url, | 160 const GURL& new_url, |
| 161 BookmarkEditor::Handler* handler); | 161 BookmarkEditor::Handler* handler); |
| 162 | 162 |
| 163 // Modifies a bookmark node assuming that the parent of the node may have | 163 // Modifies a bookmark node assuming that the parent of the node may have |
| 164 // changed and the node will need to be removed and reinserted. If the URL | 164 // changed and the node will need to be removed and reinserted. If the URL |
| 165 // changed or a new node is explicitly being added, returns a pointer to the | 165 // changed or a new node is explicitly being added, returns a pointer to the |
| 166 // new node that was created. Otherwise the return value is identically |node|. | 166 // new node that was created. Otherwise the return value is identically |node|. |
| 167 const BookmarkNode* ApplyEditsWithPossibleGroupChange( | 167 const BookmarkNode* ApplyEditsWithPossibleGroupChange( |
| 168 BookmarkModel* model, | 168 BookmarkModel* model, |
| 169 const BookmarkNode* new_parent, | 169 const BookmarkNode* new_parent, |
| 170 const BookmarkNode* node, | 170 const BookmarkEditor::EditDetails& details, |
| 171 const std::wstring& new_title, | 171 const std::wstring& new_title, |
| 172 const GURL& new_url, | 172 const GURL& new_url, |
| 173 BookmarkEditor::Handler* handler); | 173 BookmarkEditor::Handler* handler); |
| 174 | 174 |
| 175 // Toggles whether the bookmark bar is shown only on the new tab page or on | 175 // Toggles whether the bookmark bar is shown only on the new tab page or on |
| 176 // all tabs. This is a preference modifier, not a visual modifier. | 176 // all tabs. This is a preference modifier, not a visual modifier. |
| 177 void ToggleWhenVisible(Profile* profile); | 177 void ToggleWhenVisible(Profile* profile); |
| 178 | 178 |
| 179 // Register local state prefs for bookmark bar view. | 179 // Register local state prefs for bookmark bar view. |
| 180 void RegisterPrefs(PrefService* prefs); | 180 void RegisterPrefs(PrefService* prefs); |
| 181 | 181 |
| 182 // Register user prefs for BookmarkBar, BookmarkView, ... | 182 // Register user prefs for BookmarkBar, BookmarkView, ... |
| 183 void RegisterUserPrefs(PrefService* prefs); | 183 void RegisterUserPrefs(PrefService* prefs); |
| 184 | 184 |
| 185 // Fills in the URL and title for a bookmark of |tab_contents|. | 185 // Fills in the URL and title for a bookmark of |tab_contents|. |
| 186 void GetURLAndTitleToBookmark(TabContents* tab_contents, | 186 void GetURLAndTitleToBookmark(TabContents* tab_contents, |
| 187 GURL* url, | 187 GURL* url, |
| 188 std::wstring* title); | 188 std::wstring* title); |
| 189 | 189 |
| 190 // Creates a new folder containing a bookmark for each of the tabs in | 190 // Returns, by reference in |urls|, the url and title pairs for each open |
| 191 // |browser|. | 191 // tab in browser. |
| 192 const BookmarkNode* CreateBookmarkForAllTabs(Browser* browser); | 192 void GetURLsForOpenTabs(Browser* browser, |
| 193 std::vector<std::pair<GURL, std::wstring> >* urls); |
| 193 | 194 |
| 194 // Number of bookmarks we'll open before prompting the user to see if they | 195 // Number of bookmarks we'll open before prompting the user to see if they |
| 195 // really want to open all. | 196 // really want to open all. |
| 196 // | 197 // |
| 197 // NOTE: treat this as a const. It is not const as various tests change the | 198 // NOTE: treat this as a const. It is not const as various tests change the |
| 198 // value. | 199 // value. |
| 199 extern int num_urls_before_prompting; | 200 extern int num_urls_before_prompting; |
| 200 | 201 |
| 201 } // namespace bookmark_utils | 202 } // namespace bookmark_utils |
| 202 | 203 |
| 203 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 204 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
| OLD | NEW |