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_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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 12 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
13 | 13 |
14 class BookmarkModel; | 14 class BookmarkModel; |
15 class BookmarkNode; | 15 class BookmarkNode; |
16 | 16 |
17 namespace user_prefs { | 17 namespace user_prefs { |
18 class PrefRegistrySyncable; | 18 class PrefRegistrySyncable; |
19 } | 19 } |
20 | 20 |
21 // A collection of bookmark utility functions used by various parts of the UI | 21 // A collection of bookmark utility functions used by various parts of the UI |
22 // that show bookmarks: bookmark manager, bookmark bar view ... | 22 // that show bookmarks: bookmark manager, bookmark bar view ... |
23 namespace bookmark_utils { | 23 namespace bookmark_utils { |
24 | 24 |
25 // Clones bookmark node, adding newly created nodes to |parent| starting at | 25 // Clones bookmark node, adding newly created nodes to |parent| starting at |
26 // |index_to_add_at|. | 26 // |index_to_add_at|. If |reset_node_times| is true cloned bookmarks and |
| 27 // folders will receive new creation times and folder modification times |
| 28 // instead of using the values stored in |elements|. |
27 void CloneBookmarkNode(BookmarkModel* model, | 29 void CloneBookmarkNode(BookmarkModel* model, |
28 const std::vector<BookmarkNodeData::Element>& elements, | 30 const std::vector<BookmarkNodeData::Element>& elements, |
29 const BookmarkNode* parent, | 31 const BookmarkNode* parent, |
30 int index_to_add_at); | 32 int index_to_add_at, |
| 33 bool reset_node_times); |
31 | 34 |
32 // Copies nodes onto the clipboard. If |remove_nodes| is true the nodes are | 35 // Copies nodes onto the clipboard. If |remove_nodes| is true the nodes are |
33 // removed after copied to the clipboard. The nodes are copied in such a way | 36 // removed after copied to the clipboard. The nodes are copied in such a way |
34 // that if pasted again copies are made. | 37 // that if pasted again copies are made. |
35 void CopyToClipboard(BookmarkModel* model, | 38 void CopyToClipboard(BookmarkModel* model, |
36 const std::vector<const BookmarkNode*>& nodes, | 39 const std::vector<const BookmarkNode*>& nodes, |
37 bool remove_nodes); | 40 bool remove_nodes); |
38 | 41 |
39 // Pastes from the clipboard. The new nodes are added to |parent|, unless | 42 // Pastes from the clipboard. The new nodes are added to |parent|, unless |
40 // |parent| is null in which case this does nothing. The nodes are inserted | 43 // |parent| is null in which case this does nothing. The nodes are inserted |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 138 |
136 // Records the user opening a folder of bookmarks for UMA purposes. | 139 // Records the user opening a folder of bookmarks for UMA purposes. |
137 void RecordBookmarkFolderOpen(BookmarkLaunchLocation location); | 140 void RecordBookmarkFolderOpen(BookmarkLaunchLocation location); |
138 | 141 |
139 // Records the user opening the apps page for UMA purposes. | 142 // Records the user opening the apps page for UMA purposes. |
140 void RecordAppsPageOpen(BookmarkLaunchLocation location); | 143 void RecordAppsPageOpen(BookmarkLaunchLocation location); |
141 | 144 |
142 } // namespace bookmark_utils | 145 } // namespace bookmark_utils |
143 | 146 |
144 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 147 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
OLD | NEW |