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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/gfx/native_widget_types.h" | 10 #include "base/gfx/native_widget_types.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 const std::wstring& languages, | 135 const std::wstring& languages, |
136 std::vector<const BookmarkNode*>* nodes); | 136 std::vector<const BookmarkNode*>* nodes); |
137 | 137 |
138 // Returns true if |node|'s url or title contains the string |text|. | 138 // Returns true if |node|'s url or title contains the string |text|. |
139 // |languages| is user's accept-language setting to decode IDN. | 139 // |languages| is user's accept-language setting to decode IDN. |
140 bool DoesBookmarkContainText(const BookmarkNode* node, | 140 bool DoesBookmarkContainText(const BookmarkNode* node, |
141 const std::wstring& text, | 141 const std::wstring& text, |
142 const std::wstring& languages); | 142 const std::wstring& languages); |
143 | 143 |
144 // Modifies a bookmark node (assuming that there's no magic that needs to be | 144 // Modifies a bookmark node (assuming that there's no magic that needs to be |
145 // done regarding moving from one folder to another). | 145 // done regarding moving from one folder to another). If the URL changed or a |
146 void ApplyEditsWithNoGroupChange(BookmarkModel* model, | 146 // new node is explicitly being added, returns a pointer to the new node that |
147 const BookmarkNode* parent, | 147 // was created. Otherwise the return value is identically |node|. |
148 const BookmarkNode* node, | 148 const BookmarkNode* ApplyEditsWithNoGroupChange( |
149 const std::wstring& new_title, | 149 BookmarkModel* model, |
150 const GURL& new_url, | 150 const BookmarkNode* parent, |
151 BookmarkEditor::Handler* handler); | 151 const BookmarkNode* node, |
| 152 const std::wstring& new_title, |
| 153 const GURL& new_url, |
| 154 BookmarkEditor::Handler* handler); |
152 | 155 |
153 // Modifies a bookmark node assuming that the parent of the node may have | 156 // Modifies a bookmark node assuming that the parent of the node may have |
154 // changed and the node will need to be removed and reinserted. | 157 // changed and the node will need to be removed and reinserted. If the URL |
155 void ApplyEditsWithPossibleGroupChange(BookmarkModel* model, | 158 // changed or a new node is explicitly being added, returns a pointer to the |
156 const BookmarkNode* new_parent, | 159 // new node that was created. Otherwise the return value is identically |node|. |
157 const BookmarkNode* node, | 160 const BookmarkNode* ApplyEditsWithPossibleGroupChange( |
158 const std::wstring& new_title, | 161 BookmarkModel* model, |
159 const GURL& new_url, | 162 const BookmarkNode* new_parent, |
160 BookmarkEditor::Handler* handler); | 163 const BookmarkNode* node, |
| 164 const std::wstring& new_title, |
| 165 const GURL& new_url, |
| 166 BookmarkEditor::Handler* handler); |
161 | 167 |
162 // Toggles whether the bookmark bar is shown only on the new tab page or on | 168 // Toggles whether the bookmark bar is shown only on the new tab page or on |
163 // all tabs. This is a preference modifier, not a visual modifier. | 169 // all tabs. This is a preference modifier, not a visual modifier. |
164 void ToggleWhenVisible(Profile* profile); | 170 void ToggleWhenVisible(Profile* profile); |
165 | 171 |
166 // Register local state prefs for bookmark bar view. | 172 // Register local state prefs for bookmark bar view. |
167 void RegisterPrefs(PrefService* prefs); | 173 void RegisterPrefs(PrefService* prefs); |
168 | 174 |
169 // Register user prefs for BookmarkBar, BookmarkView, ... | 175 // Register user prefs for BookmarkBar, BookmarkView, ... |
170 void RegisterUserPrefs(PrefService* prefs); | 176 void RegisterUserPrefs(PrefService* prefs); |
171 | 177 |
172 // Number of bookmarks we'll open before prompting the user to see if they | 178 // Number of bookmarks we'll open before prompting the user to see if they |
173 // really want to open all. | 179 // really want to open all. |
174 // | 180 // |
175 // NOTE: treat this as a const. It is not const as various tests change the | 181 // NOTE: treat this as a const. It is not const as various tests change the |
176 // value. | 182 // value. |
177 extern int num_urls_before_prompting; | 183 extern int num_urls_before_prompting; |
178 | 184 |
179 } // namespace bookmark_utils | 185 } // namespace bookmark_utils |
180 | 186 |
181 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 187 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
OLD | NEW |