diff options
author | feldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-07 03:43:51 +0000 |
---|---|---|
committer | feldstein@chromium.org <feldstein@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-07 03:43:51 +0000 |
commit | eda74d6837b1d8915a15f1a0598d1ce3c99b5cb0 (patch) | |
tree | 22f0a72166f5f9b34e37974489b991319ec16baf /chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h | |
parent | c3c91a64cba4f083f0aed48a7c4719303dd89e7d (diff) | |
download | chromium_src-eda74d6837b1d8915a15f1a0598d1ce3c99b5cb0.zip chromium_src-eda74d6837b1d8915a15f1a0598d1ce3c99b5cb0.tar.gz chromium_src-eda74d6837b1d8915a15f1a0598d1ce3c99b5cb0.tar.bz2 |
Initial implementation of Drag and Drop for the extension BMM.
Review URL: http://codereview.chromium.org/660139
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h')
-rw-r--r-- | chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h index 357671e..4366b44 100644 --- a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h +++ b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h @@ -5,16 +5,47 @@ #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ -#import "chrome/browser/bookmarks/bookmark_drag_data.h" +#include "app/gfx/native_widget_types.h" +#include "base/file_path.h" +#include "chrome/browser/bookmarks/bookmark_drag_data.h" +// This set of functions lets C++ code interact with the cocoa pasteboard +// and dragging methods. namespace bookmark_pasteboard_helper_mac { -void WriteToClipboard(const std::vector<BookmarkDragData::Element>& elements); +// Writes a set of bookmark elements from a profile to the general pasteboard. +// This should be used for copy/paste functions. +void WriteToClipboard(const std::vector<BookmarkDragData::Element>& elements, + FilePath::StringType profile_path); -bool ReadFromClipboard(std::vector<BookmarkDragData::Element>& elements); +// Writes a set of bookmark elements from a profile to the dragging pasteboard +// for drag and drop functions. +void WriteToDragClipboard( + const std::vector<BookmarkDragData::Element>& elements, + FilePath::StringType profile_path); +// Reads a set of bookmark elements from the general copy/paste clipboard. +bool ReadFromClipboard(std::vector<BookmarkDragData::Element>& elements, + FilePath::StringType* profile_path); + +// Reads a set of bookmark elements from the drag and drop clipboard. +bool ReadFromDragClipboard(std::vector<BookmarkDragData::Element>& elements, + FilePath::StringType* profile_path); + +// Returns true if the general copy/paste pasteboard contains any sort of +// bookmark elements. It currently does not consider a plaintext url a +// valid bookmark. bool ClipboardContainsBookmarks(); +// Returns true if the dragging pasteboard contains any sort of bookmark +// elements. +bool DragClipboardContainsBookmarks(); + +// Copies the bookmark nodes to the dragging pasteboard and initiates a +// drag from the specified view. |view| must be a |TabContentsViewCocoa*|. +void StartDrag(Profile* profile, const std::vector<const BookmarkNode*>& nodes, + gfx::NativeView view); + } #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_PASTEBOARD_HELPER_MAC_H_ |