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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Reads bookmarks from the given vector. | 90 // Reads bookmarks from the given vector. |
91 bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); | 91 bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes); |
92 | 92 |
93 // Creates a single-bookmark DragData from url/title pair. | 93 // Creates a single-bookmark DragData from url/title pair. |
94 bool ReadFromTuple(const GURL& url, const string16& title); | 94 bool ReadFromTuple(const GURL& url, const string16& title); |
95 | 95 |
96 // Writes elements to the clipboard. | 96 // Writes elements to the clipboard. |
97 void WriteToClipboard(Profile* profile) const; | 97 void WriteToClipboard(Profile* profile) const; |
98 | 98 |
99 // Reads bookmarks from the general copy/paste clipboard. Prefers data | 99 // Reads bookmarks from the general copy/paste clipboard. Prefers data |
100 // written via WriteToClipboard but will also attempt to read a plain bookmark
. | 100 // written via WriteToClipboard but will also attempt to read a plain |
| 101 // bookmark. |
101 bool ReadFromClipboard(); | 102 bool ReadFromClipboard(); |
102 #if defined(OS_MACOSX) | 103 #if defined(OS_MACOSX) |
103 // Reads bookmarks that are being dragged from the drag and drop | 104 // Reads bookmarks that are being dragged from the drag and drop |
104 // pasteboard. | 105 // pasteboard. |
105 bool ReadFromDragClipboard(); | 106 bool ReadFromDragClipboard(); |
106 #endif | 107 #endif |
107 | 108 |
108 #if defined(TOOLKIT_VIEWS) | 109 #if defined(TOOLKIT_VIEWS) |
109 // Writes elements to data. If there is only one element and it is a URL | 110 // Writes elements to data. If there is only one element and it is a URL |
110 // the URL and title are written to the clipboard in a format other apps can | 111 // the URL and title are written to the clipboard in a format other apps can |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 static const char* kClipboardFormatString; | 161 static const char* kClipboardFormatString; |
161 | 162 |
162 static bool ClipboardContainsBookmarks(); | 163 static bool ClipboardContainsBookmarks(); |
163 | 164 |
164 private: | 165 private: |
165 // Path of the profile we originated from. | 166 // Path of the profile we originated from. |
166 FilePath::StringType profile_path_; | 167 FilePath::StringType profile_path_; |
167 }; | 168 }; |
168 | 169 |
169 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_ | 170 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_ |
OLD | NEW |