| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_NODE_DATA_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 explicit BookmarkNodeData(const std::vector<const BookmarkNode*>& nodes); | 81 explicit BookmarkNodeData(const std::vector<const BookmarkNode*>& nodes); |
| 82 | 82 |
| 83 ~BookmarkNodeData(); | 83 ~BookmarkNodeData(); |
| 84 | 84 |
| 85 // Reads bookmarks from the given vector. | 85 // Reads bookmarks from the given vector. |
| 86 bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); | 86 bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); |
| 87 | 87 |
| 88 // Creates a single-bookmark DragData from url/title pair. | 88 // Creates a single-bookmark DragData from url/title pair. |
| 89 bool ReadFromTuple(const GURL& url, const string16& title); | 89 bool ReadFromTuple(const GURL& url, const string16& title); |
| 90 | 90 |
| 91 // Writes elements to the clipboard. | 91 // Writes elements to the clipboard. If |profile| is not NULL, this will write |
| 92 // the profile path to the pickled data. A NULL |profile| indicates that the |
| 93 // data is not associated with a particular profile. |
| 92 void WriteToClipboard(Profile* profile) const; | 94 void WriteToClipboard(Profile* profile) const; |
| 93 | 95 |
| 94 // Reads bookmarks from the general copy/paste clipboard. Prefers data | 96 // Reads bookmarks from the general copy/paste clipboard. Prefers data |
| 95 // written via WriteToClipboard but will also attempt to read a plain | 97 // written via WriteToClipboard but will also attempt to read a plain |
| 96 // bookmark. | 98 // bookmark. |
| 97 bool ReadFromClipboard(); | 99 bool ReadFromClipboard(); |
| 98 #if defined(OS_MACOSX) | 100 #if defined(OS_MACOSX) |
| 99 // Reads bookmarks that are being dragged from the drag and drop | 101 // Reads bookmarks that are being dragged from the drag and drop |
| 100 // pasteboard. | 102 // pasteboard. |
| 101 bool ReadFromDragClipboard(); | 103 bool ReadFromDragClipboard(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 static const char* kClipboardFormatString; | 158 static const char* kClipboardFormatString; |
| 157 | 159 |
| 158 static bool ClipboardContainsBookmarks(); | 160 static bool ClipboardContainsBookmarks(); |
| 159 | 161 |
| 160 private: | 162 private: |
| 161 // Path of the profile we originated from. | 163 // Path of the profile we originated from. |
| 162 FilePath profile_path_; | 164 FilePath profile_path_; |
| 163 }; | 165 }; |
| 164 | 166 |
| 165 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ | 167 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_ |
| OLD | NEW |