| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_DRAG_DATA_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 static OSExchangeData::CustomFormat GetBookmarkCustomFormat(); | 82 static OSExchangeData::CustomFormat GetBookmarkCustomFormat(); |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 // Created a BookmarkDragData populated from the arguments. | 85 // Created a BookmarkDragData populated from the arguments. |
| 86 explicit BookmarkDragData(const BookmarkNode* node); | 86 explicit BookmarkDragData(const BookmarkNode* node); |
| 87 explicit BookmarkDragData(const std::vector<const BookmarkNode*>& nodes); | 87 explicit BookmarkDragData(const std::vector<const BookmarkNode*>& nodes); |
| 88 | 88 |
| 89 // Reads bookmarks from the given vector. | 89 // Reads bookmarks from the given vector. |
| 90 bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); | 90 bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); |
| 91 | 91 |
| 92 // Creates a single-bookmark DragData from url/title pair. |
| 93 bool ReadFromTuple(const GURL& url, const string16& title); |
| 94 |
| 92 // Writes elements to the clipboard. | 95 // Writes elements to the clipboard. |
| 93 void WriteToClipboard(Profile* profile) const; | 96 void WriteToClipboard(Profile* profile) const; |
| 94 | 97 |
| 95 // Reads bookmarks from the general copy/paste clipboard. Prefers data | 98 // Reads bookmarks from the general copy/paste clipboard. Prefers data |
| 96 // written via WriteToClipboard but will also attempt to read a plain bookmark
. | 99 // written via WriteToClipboard but will also attempt to read a plain bookmark
. |
| 97 bool ReadFromClipboard(); | 100 bool ReadFromClipboard(); |
| 98 #if defined(OS_MACOSX) | 101 #if defined(OS_MACOSX) |
| 99 // Reads bookmarks that are being dragged from the drag and drop | 102 // Reads bookmarks that are being dragged from the drag and drop |
| 100 // pasteboard. | 103 // pasteboard. |
| 101 bool ReadFromDragClipboard(); | 104 bool ReadFromDragClipboard(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 static const char* kClipboardFormatString; | 159 static const char* kClipboardFormatString; |
| 157 | 160 |
| 158 static bool ClipboardContainsBookmarks(); | 161 static bool ClipboardContainsBookmarks(); |
| 159 | 162 |
| 160 private: | 163 private: |
| 161 // Path of the profile we originated from. | 164 // Path of the profile we originated from. |
| 162 FilePath::StringType profile_path_; | 165 FilePath::StringType profile_path_; |
| 163 }; | 166 }; |
| 164 | 167 |
| 165 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_ | 168 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_ |
| OLD | NEW |