| 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/string16.h" | 11 #include "base/string16.h" |
| 12 #include "chrome/browser/bookmarks/bookmark_editor.h" | 12 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 13 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 13 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
| 14 #include "chrome/browser/history/snippet.h" | 14 #include "chrome/browser/history/snippet.h" |
| 15 #include "ui/gfx/native_widget_types.h" | |
| 16 | 15 |
| 17 class BookmarkModel; | 16 class BookmarkModel; |
| 18 class BookmarkNode; | 17 class BookmarkNode; |
| 19 class PrefRegistrySyncable; | 18 class PrefRegistrySyncable; |
| 20 class Profile; | |
| 21 | |
| 22 namespace content { | |
| 23 class BrowserContext; | |
| 24 } | |
| 25 | |
| 26 namespace ui { | |
| 27 class DropTargetEvent; | |
| 28 } | |
| 29 | 19 |
| 30 // A collection of bookmark utility functions used by various parts of the UI | 20 // A collection of bookmark utility functions used by various parts of the UI |
| 31 // that show bookmarks: bookmark manager, bookmark bar view ... | 21 // that show bookmarks: bookmark manager, bookmark bar view ... |
| 32 namespace bookmark_utils { | 22 namespace bookmark_utils { |
| 33 | 23 |
| 34 // Performs a drop of bookmark data onto |parent_node| at |index|. Returns the | |
| 35 // type of drop the resulted. | |
| 36 int PerformBookmarkDrop(Profile* profile, | |
| 37 const BookmarkNodeData& data, | |
| 38 const BookmarkNode* parent_node, | |
| 39 int index); | |
| 40 | |
| 41 // Clones bookmark node, adding newly created nodes to |parent| starting at | 24 // Clones bookmark node, adding newly created nodes to |parent| starting at |
| 42 // |index_to_add_at|. | 25 // |index_to_add_at|. |
| 43 void CloneBookmarkNode(BookmarkModel* model, | 26 void CloneBookmarkNode(BookmarkModel* model, |
| 44 const std::vector<BookmarkNodeData::Element>& elements, | 27 const std::vector<BookmarkNodeData::Element>& elements, |
| 45 const BookmarkNode* parent, | 28 const BookmarkNode* parent, |
| 46 int index_to_add_at); | 29 int index_to_add_at); |
| 47 | 30 |
| 48 // Copies nodes onto the clipboard. If |remove_nodes| is true the nodes are | 31 // Copies nodes onto the clipboard. If |remove_nodes| is true the nodes are |
| 49 // removed after copied to the clipboard. The nodes are copied in such a way | 32 // removed after copied to the clipboard. The nodes are copied in such a way |
| 50 // that if pasted again copies are made. | 33 // that if pasted again copies are made. |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 168 |
| 186 // Records the user opening a folder of bookmarks for UMA purposes. | 169 // Records the user opening a folder of bookmarks for UMA purposes. |
| 187 void RecordBookmarkFolderOpen(BookmarkLaunchLocation location); | 170 void RecordBookmarkFolderOpen(BookmarkLaunchLocation location); |
| 188 | 171 |
| 189 // Records the user opening the apps page for UMA purposes. | 172 // Records the user opening the apps page for UMA purposes. |
| 190 void RecordAppsPageOpen(BookmarkLaunchLocation location); | 173 void RecordAppsPageOpen(BookmarkLaunchLocation location); |
| 191 | 174 |
| 192 } // namespace bookmark_utils | 175 } // namespace bookmark_utils |
| 193 | 176 |
| 194 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ | 177 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_UTILS_H_ |
| OLD | NEW |