Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_ | 
| 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 int index_to_add_at, | 47 int index_to_add_at, | 
| 48 bool reset_node_times); | 48 bool reset_node_times); | 
| 49 | 49 | 
| 50 // Copies nodes onto the clipboard. If |remove_nodes| is true the nodes are | 50 // Copies nodes onto the clipboard. If |remove_nodes| is true the nodes are | 
| 51 // removed after copied to the clipboard. The nodes are copied in such a way | 51 // removed after copied to the clipboard. The nodes are copied in such a way | 
| 52 // that if pasted again copies are made. | 52 // that if pasted again copies are made. | 
| 53 void CopyToClipboard(BookmarkModel* model, | 53 void CopyToClipboard(BookmarkModel* model, | 
| 54 const std::vector<const BookmarkNode*>& nodes, | 54 const std::vector<const BookmarkNode*>& nodes, | 
| 55 bool remove_nodes); | 55 bool remove_nodes); | 
| 56 | 56 | 
| 57 // This helper function will give new title for the bookmark when same | |
| 58 // bookmark already exist under parent node. | |
| 59 void UpdateCopiedBookmarkTitle(BookmarkModel* model, | |
| 
 
sky
2014/09/30 15:45:16
Why is this in the header? AFAICT it's only needed
 
Deepak
2014/10/01 05:13:10
Done.
 
 | |
| 60 const BookmarkNode* parent, | |
| 61 BookmarkNodeData* bookmark_data); | |
| 62 | |
| 57 // Pastes from the clipboard. The new nodes are added to |parent|, unless | 63 // Pastes from the clipboard. The new nodes are added to |parent|, unless | 
| 58 // |parent| is null in which case this does nothing. The nodes are inserted | 64 // |parent| is null in which case this does nothing. The nodes are inserted | 
| 59 // at |index|. If |index| is -1 the nodes are added to the end. | 65 // at |index|. If |index| is -1 the nodes are added to the end. | 
| 60 void PasteFromClipboard(BookmarkModel* model, | 66 void PasteFromClipboard(BookmarkModel* model, | 
| 61 const BookmarkNode* parent, | 67 const BookmarkNode* parent, | 
| 62 int index); | 68 int index); | 
| 63 | 69 | 
| 64 // Returns true if the user can copy from the pasteboard. | 70 // Returns true if the user can copy from the pasteboard. | 
| 65 bool CanPasteFromClipboard(BookmarkModel* model, const BookmarkNode* node); | 71 bool CanPasteFromClipboard(BookmarkModel* model, const BookmarkNode* node); | 
| 66 | 72 | 
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 // Returns true if |url| has a bookmark in the |model| that can be edited | 152 // Returns true if |url| has a bookmark in the |model| that can be edited | 
| 147 // by the user. | 153 // by the user. | 
| 148 bool IsBookmarkedByUser(BookmarkModel* model, const GURL& url); | 154 bool IsBookmarkedByUser(BookmarkModel* model, const GURL& url); | 
| 149 | 155 | 
| 150 // Returns the node with |id|, or NULL if there is no node with |id|. | 156 // Returns the node with |id|, or NULL if there is no node with |id|. | 
| 151 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id); | 157 const BookmarkNode* GetBookmarkNodeByID(const BookmarkModel* model, int64 id); | 
| 152 | 158 | 
| 153 } // namespace bookmarks | 159 } // namespace bookmarks | 
| 154 | 160 | 
| 155 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_ | 161 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_UTILS_H_ | 
| OLD | NEW |