bookmark_pasteboard_helper_mac.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
  5. #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_PASTEBOARD_HELPER_MAC_H_
  6. #import <AppKit/AppKit.h>
  7. #include "components/bookmarks/browser/bookmark_node_data.h"
  8. namespace base {
  9. class FilePath;
  10. }
  11. namespace bookmarks {
  12. // Writes a set of bookmark elements from a profile to the specified pasteboard.
  13. void WriteBookmarksToPasteboard(
  14. NSPasteboard* pb,
  15. const std::vector<BookmarkNodeData::Element>& elements,
  16. const base::FilePath& profile_path);
  17. // Reads a set of bookmark elements from the specified pasteboard.
  18. bool ReadBookmarksFromPasteboard(
  19. NSPasteboard* pb,
  20. std::vector<BookmarkNodeData::Element>* elements,
  21. base::FilePath* profile_path);
  22. // Returns true if the specified pasteboard contains any sort of bookmark
  23. // elements. It currently does not consider a plaintext url a valid bookmark.
  24. bool PasteboardContainsBookmarks(NSPasteboard* pb);
  25. // UTI for dictionary containing bookmark structure consisting of individual
  26. // bookmark nodes and/or bookmark folders.
  27. extern NSString* const kUTTypeChromiumBookmarkDictionaryList;
  28. } // namespace bookmarks
  29. #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_PASTEBOARD_HELPER_MAC_H_