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> |
11 | 11 |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "chrome/browser/bookmarks/bookmark_editor.h" | 13 #include "chrome/browser/bookmarks/bookmark_editor.h" |
14 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 14 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
15 #include "chrome/browser/history/snippet.h" | 15 #include "chrome/browser/history/snippet.h" |
16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
17 #include "webkit/glue/window_open_disposition.h" | 17 #include "webkit/glue/window_open_disposition.h" |
18 | 18 |
19 class BookmarkModel; | 19 class BookmarkModel; |
20 class BookmarkNode; | 20 class BookmarkNode; |
21 class Browser; | 21 class Browser; |
22 class PrefService; | 22 class PrefService; |
23 class Profile; | 23 class Profile; |
24 class TabContents; | 24 class TabContents; |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 class PageNavigator; | 27 class PageNavigator; |
| 28 class WebContents; |
28 } | 29 } |
29 | 30 |
30 namespace views { | 31 namespace views { |
31 class DropTargetEvent; | 32 class DropTargetEvent; |
32 } | 33 } |
33 | 34 |
34 // A collection of bookmark utility functions used by various parts of the UI | 35 // A collection of bookmark utility functions used by various parts of the UI |
35 // that show bookmarks: bookmark manager, bookmark bar view ... | 36 // that show bookmarks: bookmark manager, bookmark bar view ... |
36 namespace bookmark_utils { | 37 namespace bookmark_utils { |
37 | 38 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 const string16& new_title, | 185 const string16& new_title, |
185 const GURL& new_url); | 186 const GURL& new_url); |
186 | 187 |
187 // Toggles whether the bookmark bar is shown only on the new tab page or on | 188 // Toggles whether the bookmark bar is shown only on the new tab page or on |
188 // all tabs. This is a preference modifier, not a visual modifier. | 189 // all tabs. This is a preference modifier, not a visual modifier. |
189 void ToggleWhenVisible(Profile* profile); | 190 void ToggleWhenVisible(Profile* profile); |
190 | 191 |
191 // Register user preferences for BookmarksBar. | 192 // Register user preferences for BookmarksBar. |
192 void RegisterUserPrefs(PrefService* prefs); | 193 void RegisterUserPrefs(PrefService* prefs); |
193 | 194 |
194 // Fills in the URL and title for a bookmark of |tab_contents|. | 195 // Fills in the URL and title for a bookmark of |web_contents|. |
195 void GetURLAndTitleToBookmark(TabContents* tab_contents, | 196 void GetURLAndTitleToBookmark(content::WebContents* web_contents, |
196 GURL* url, | 197 GURL* url, |
197 string16* title); | 198 string16* title); |
198 | 199 |
199 // Fills in the URL and title for a bookmark from the current tab of the | 200 // Fills in the URL and title for a bookmark from the current tab of the |
200 // specified profile. | 201 // specified profile. |
201 void GetURLAndTitleToBookmarkFromCurrentTab(Profile* profile, | 202 void GetURLAndTitleToBookmarkFromCurrentTab(Profile* profile, |
202 GURL* url, | 203 GURL* url, |
203 string16* title); | 204 string16* title); |
204 | 205 |
205 // Returns, by reference in |urls|, the url and title pairs for each open | 206 // Returns, by reference in |urls|, the url and title pairs for each open |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 264 |
264 LAUNCH_LIMIT // Keep this last. | 265 LAUNCH_LIMIT // Keep this last. |
265 }; | 266 }; |
266 | 267 |
267 // Records the launch of a bookmark for UMA purposes. | 268 // Records the launch of a bookmark for UMA purposes. |
268 void RecordBookmarkLaunch(BookmarkLaunchLocation location); | 269 void RecordBookmarkLaunch(BookmarkLaunchLocation location); |
269 | 270 |
270 } // namespace bookmark_utils | 271 } // namespace bookmark_utils |
271 | 272 |
272 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 273 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
OLD | NEW |