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" |
11 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 11 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
12 #include "chrome/browser/history/snippet.h" | 12 #include "chrome/browser/history/snippet.h" |
13 #include "webkit/glue/window_open_disposition.h" | 13 #include "webkit/glue/window_open_disposition.h" |
14 | 14 |
15 class BookmarkModel; | 15 class BookmarkModel; |
16 class BookmarkNode; | 16 class BookmarkNode; |
17 class PageNavigator; | 17 class PageNavigator; |
| 18 class PrefService; |
18 class Profile; | 19 class Profile; |
19 | 20 |
20 namespace views { | 21 namespace views { |
21 class DropTargetEvent; | 22 class DropTargetEvent; |
22 } | 23 } |
23 | 24 |
24 // A collection of bookmark utility functions used by various parts of the UI | 25 // A collection of bookmark utility functions used by various parts of the UI |
25 // that show bookmarks: bookmark manager, bookmark bar view ... | 26 // that show bookmarks: bookmark manager, bookmark bar view ... |
26 namespace bookmark_utils { | 27 namespace bookmark_utils { |
27 | 28 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // Returns up to |max_count| bookmarks from |model| whose url or title contains | 135 // Returns up to |max_count| bookmarks from |model| whose url or title contains |
135 // the text |text|. | 136 // the text |text|. |
136 void GetBookmarksContainingText(BookmarkModel* model, | 137 void GetBookmarksContainingText(BookmarkModel* model, |
137 const std::wstring& text, | 138 const std::wstring& text, |
138 size_t max_count, | 139 size_t max_count, |
139 std::vector<BookmarkNode*>* nodes); | 140 std::vector<BookmarkNode*>* nodes); |
140 | 141 |
141 // Returns true if |node|'s url or title contains the string |text|. | 142 // Returns true if |node|'s url or title contains the string |text|. |
142 bool DoesBookmarkContainText(BookmarkNode* node, const std::wstring& text); | 143 bool DoesBookmarkContainText(BookmarkNode* node, const std::wstring& text); |
143 | 144 |
| 145 // Toggles whether the bookmark bar is shown only on the new tab page or on |
| 146 // all tabs. This is a preference modifier, not a visual modifier. |
| 147 void ToggleWhenVisible(Profile* profile); |
| 148 |
| 149 // Register user prefs for BookmarkBar, BookmarkView, ... |
| 150 void RegisterUserPrefs(PrefService* prefs); |
| 151 |
144 // Number of bookmarks we'll open before prompting the user to see if they | 152 // Number of bookmarks we'll open before prompting the user to see if they |
145 // really want to open all. | 153 // really want to open all. |
146 // | 154 // |
147 // NOTE: treat this as a const. It is not const as various tests change the | 155 // NOTE: treat this as a const. It is not const as various tests change the |
148 // value. | 156 // value. |
149 extern int num_urls_before_prompting; | 157 extern int num_urls_before_prompting; |
150 | 158 |
151 } // namespace bookmark_utils | 159 } // namespace bookmark_utils |
152 | 160 |
153 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 161 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
OLD | NEW |