| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PASTEBOARD_HELPER_MAC_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 8 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
| 9 | 9 |
| 10 #if defined(__OBJC__) | 10 #if defined(__OBJC__) |
| 11 @class NSString; | 11 @class NSString; |
| 12 #endif // __OBJC__ | 12 #endif // __OBJC__ |
| 13 | 13 |
| 14 namespace base { |
| 14 class FilePath; | 15 class FilePath; |
| 16 } |
| 15 | 17 |
| 16 // This set of functions lets C++ code interact with the cocoa pasteboard | 18 // This set of functions lets C++ code interact with the cocoa pasteboard |
| 17 // and dragging methods. | 19 // and dragging methods. |
| 18 namespace bookmark_pasteboard_helper_mac { | 20 namespace bookmark_pasteboard_helper_mac { |
| 19 | 21 |
| 20 enum PasteboardType { | 22 enum PasteboardType { |
| 21 kCopyPastePasteboard, | 23 kCopyPastePasteboard, |
| 22 kDragPasteboard | 24 kDragPasteboard |
| 23 }; | 25 }; |
| 24 | 26 |
| 25 // Writes a set of bookmark elements from a profile to the specified pasteboard. | 27 // Writes a set of bookmark elements from a profile to the specified pasteboard. |
| 26 void WriteToPasteboard(PasteboardType type, | 28 void WriteToPasteboard(PasteboardType type, |
| 27 const std::vector<BookmarkNodeData::Element>& elements, | 29 const std::vector<BookmarkNodeData::Element>& elements, |
| 28 const FilePath& profile_path); | 30 const base::FilePath& profile_path); |
| 29 | 31 |
| 30 // Reads a set of bookmark elements from the specified pasteboard. | 32 // Reads a set of bookmark elements from the specified pasteboard. |
| 31 bool ReadFromPasteboard(PasteboardType type, | 33 bool ReadFromPasteboard(PasteboardType type, |
| 32 std::vector<BookmarkNodeData::Element>& elements, | 34 std::vector<BookmarkNodeData::Element>& elements, |
| 33 FilePath* profile_path); | 35 base::FilePath* profile_path); |
| 34 | 36 |
| 35 // Returns true if the specified pasteboard contains any sort of | 37 // Returns true if the specified pasteboard contains any sort of |
| 36 // bookmark elements. It currently does not consider a plaintext url a | 38 // bookmark elements. It currently does not consider a plaintext url a |
| 37 // valid bookmark. | 39 // valid bookmark. |
| 38 bool PasteboardContainsBookmarks(PasteboardType type); | 40 bool PasteboardContainsBookmarks(PasteboardType type); |
| 39 | 41 |
| 40 } // namespace bookmark_pasteboard_helper_mac | 42 } // namespace bookmark_pasteboard_helper_mac |
| 41 | 43 |
| 42 #if defined(__OBJC__) | 44 #if defined(__OBJC__) |
| 43 // Pasteboard type for dictionary containing bookmark structure consisting | 45 // Pasteboard type for dictionary containing bookmark structure consisting |
| 44 // of individual bookmark nodes and/or bookmark folders. | 46 // of individual bookmark nodes and/or bookmark folders. |
| 45 extern "C" NSString* const kBookmarkDictionaryListPboardType; | 47 extern "C" NSString* const kBookmarkDictionaryListPboardType; |
| 46 #endif // __OBJC__ | 48 #endif // __OBJC__ |
| 47 | 49 |
| 48 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ | 50 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ |
| OLD | NEW |