OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_BOOKMARKS_BOOKMARK_UTILS_H_ | 5 #ifndef CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_UTILS_H_ |
6 #define CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_UTILS_H_ | 6 #define CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_UTILS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 #include "webkit/glue/window_open_disposition.h" | 12 #include "webkit/glue/window_open_disposition.h" |
13 | 13 |
14 class BookmarkNode; | 14 class BookmarkNode; |
15 class Browser; | 15 class Browser; |
16 class GURL; | 16 class GURL; |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 class BrowserContext; | 19 class BrowserContext; |
20 class PageNavigator; | 20 class PageNavigator; |
21 class WebContents; | 21 class WebContents; |
22 } | 22 } |
23 | 23 |
24 namespace chrome { | 24 namespace chrome { |
25 | 25 |
26 // Opens all the bookmarks in |nodes| that are of type url and all the child | 26 // Opens all the bookmarks in |nodes| that are of type url and all the child |
27 // bookmarks that are of type url for folders in |nodes|. |initial_disposition| | 27 // bookmarks that are of type url for folders in |nodes|. |initial_disposition| |
28 // dictates how the first URL is opened, all subsequent URLs are opened as | 28 // dictates how the first URL is opened, all subsequent URLs are opened as |
29 // background tabs. |navigator| is used to open the URLs. | 29 // background tabs. |navigator| is used to open the URLs. |
30 // When |initial_disposition| is OFF_THE_RECORD, a node which can't be opened | |
sky
2012/12/14 17:41:12
Remove this sentence, it's an implementation detai
| |
31 // in incognito window, it is detected using |browser_context|, is not opened. | |
30 void OpenAll(gfx::NativeWindow parent, | 32 void OpenAll(gfx::NativeWindow parent, |
31 content::PageNavigator* navigator, | 33 content::PageNavigator* navigator, |
32 const std::vector<const BookmarkNode*>& nodes, | 34 const std::vector<const BookmarkNode*>& nodes, |
33 WindowOpenDisposition initial_disposition); | 35 WindowOpenDisposition initial_disposition, |
36 content::BrowserContext* browser_context); | |
34 | 37 |
35 // Convenience for OpenAll() with a single BookmarkNode. | 38 // Convenience for OpenAll() with a single BookmarkNode. |
36 void OpenAll(gfx::NativeWindow parent, | 39 void OpenAll(gfx::NativeWindow parent, |
37 content::PageNavigator* navigator, | 40 content::PageNavigator* navigator, |
38 const BookmarkNode* node, | 41 const BookmarkNode* node, |
39 WindowOpenDisposition initial_disposition); | 42 WindowOpenDisposition initial_disposition, |
43 content::BrowserContext* browser_context); | |
40 | 44 |
41 // Asks the user before deleting a non-empty bookmark folder. | 45 // Asks the user before deleting a non-empty bookmark folder. |
42 bool ConfirmDeleteBookmarkNode(const BookmarkNode* node, | 46 bool ConfirmDeleteBookmarkNode(const BookmarkNode* node, |
43 gfx::NativeWindow window); | 47 gfx::NativeWindow window); |
44 | 48 |
45 // Shows the bookmark all tabs dialog. | 49 // Shows the bookmark all tabs dialog. |
46 void ShowBookmarkAllTabsDialog(Browser* browser); | 50 void ShowBookmarkAllTabsDialog(Browser* browser); |
47 | 51 |
48 // Returns true if |selection| has at least one bookmark of type url. | 52 // Returns true if |selection| has at least one bookmark of type url. |
49 bool HasBookmarkURLs(const std::vector<const BookmarkNode*>& selection); | 53 bool HasBookmarkURLs(const std::vector<const BookmarkNode*>& selection); |
50 | 54 |
51 // Fills in the URL and title for a bookmark of |web_contents|. | 55 // Fills in the URL and title for a bookmark of |web_contents|. |
52 void GetURLAndTitleToBookmark(content::WebContents* web_contents, | 56 void GetURLAndTitleToBookmark(content::WebContents* web_contents, |
53 GURL* url, | 57 GURL* url, |
54 string16* title); | 58 string16* title); |
55 | 59 |
56 // Toggles whether the bookmark bar is shown only on the new tab page or on | 60 // Toggles whether the bookmark bar is shown only on the new tab page or on |
57 // all tabs. This is a preference modifier, not a visual modifier. | 61 // all tabs. This is a preference modifier, not a visual modifier. |
58 void ToggleBookmarkBarWhenVisible(content::BrowserContext* browser_context); | 62 void ToggleBookmarkBarWhenVisible(content::BrowserContext* browser_context); |
59 | 63 |
60 } // namespace chrome | 64 } // namespace chrome |
61 | 65 |
62 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_UTILS_H_ | 66 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_UTILS_H_ |
OLD | NEW |