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 "chrome/browser/bookmarks/bookmark_drag_data.h" | 10 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 BookmarkNode* drop_parent, | 35 BookmarkNode* drop_parent, |
36 int index); | 36 int index); |
37 | 37 |
38 // Clones drag data, adding newly created nodes to |parent| starting at | 38 // Clones drag data, adding newly created nodes to |parent| starting at |
39 // |index_to_add_at|. | 39 // |index_to_add_at|. |
40 void CloneDragData(BookmarkModel* model, | 40 void CloneDragData(BookmarkModel* model, |
41 const std::vector<BookmarkDragData::Element>& elements, | 41 const std::vector<BookmarkDragData::Element>& elements, |
42 BookmarkNode* parent, | 42 BookmarkNode* parent, |
43 int index_to_add_at); | 43 int index_to_add_at); |
44 | 44 |
45 #if defined(OS_WIN) | |
46 // TODO(port): Make OpenAll portable (remove HWND). | |
47 | |
48 // Recursively opens all bookmarks. |initial_disposition| dictates how the | 45 // Recursively opens all bookmarks. |initial_disposition| dictates how the |
49 // first URL is opened, all subsequent URLs are opened as background tabs. | 46 // first URL is opened, all subsequent URLs are opened as background tabs. |
50 // |navigator| is used to open the URLs. If |navigator| is NULL the last | 47 // |navigator| is used to open the URLs. If |navigator| is NULL the last |
51 // tabbed browser with the profile |profile| is used. If there is no browser | 48 // tabbed browser with the profile |profile| is used. If there is no browser |
52 // with the specified profile a new one is created. | 49 // with the specified profile a new one is created. |
53 void OpenAll(HWND parent, | 50 void OpenAll(HWND parent, |
54 Profile* profile, | 51 Profile* profile, |
55 PageNavigator* navigator, | 52 PageNavigator* navigator, |
56 const std::vector<BookmarkNode*>& nodes, | 53 const std::vector<BookmarkNode*>& nodes, |
57 WindowOpenDisposition initial_disposition); | 54 WindowOpenDisposition initial_disposition); |
58 | 55 |
59 // Convenience for opening a single BookmarkNode. | 56 // Convenience for opening a single BookmarkNode. |
60 void OpenAll(HWND parent, | 57 void OpenAll(HWND parent, |
61 Profile* profile, | 58 Profile* profile, |
62 PageNavigator* navigator, | 59 PageNavigator* navigator, |
63 BookmarkNode* node, | 60 BookmarkNode* node, |
64 WindowOpenDisposition initial_disposition); | 61 WindowOpenDisposition initial_disposition); |
65 #endif // defined(OS_WIN) | |
66 | 62 |
67 // Copies nodes onto the clipboard. If |remove_nodes| is true the nodes are | 63 // Copies nodes onto the clipboard. If |remove_nodes| is true the nodes are |
68 // removed after copied to the clipboard. The nodes are copied in such a way | 64 // removed after copied to the clipboard. The nodes are copied in such a way |
69 // that if pasted again copies are made. | 65 // that if pasted again copies are made. |
70 void CopyToClipboard(BookmarkModel* model, | 66 void CopyToClipboard(BookmarkModel* model, |
71 const std::vector<BookmarkNode*>& nodes, | 67 const std::vector<BookmarkNode*>& nodes, |
72 bool remove_nodes); | 68 bool remove_nodes); |
73 | 69 |
74 // Pastes from the clipboard. The new nodes are added to |parent|, unless | 70 // Pastes from the clipboard. The new nodes are added to |parent|, unless |
75 // |parent| is null in which case this does nothing. The nodes are inserted | 71 // |parent| is null in which case this does nothing. The nodes are inserted |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // Number of bookmarks we'll open before prompting the user to see if they | 120 // Number of bookmarks we'll open before prompting the user to see if they |
125 // really want to open all. | 121 // really want to open all. |
126 // | 122 // |
127 // NOTE: treat this as a const. It is not const as various tests change the | 123 // NOTE: treat this as a const. It is not const as various tests change the |
128 // value. | 124 // value. |
129 extern int num_urls_before_prompting; | 125 extern int num_urls_before_prompting; |
130 | 126 |
131 } // namespace bookmark_utils | 127 } // namespace bookmark_utils |
132 | 128 |
133 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 129 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
OLD | NEW |