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 UI_BASE_DRAGDROP_MAC_DND_UTIL_H_ | 5 #ifndef UI_BASE_DRAGDROP_MAC_DND_UTIL_H_ |
6 #define UI_BASE_DRAGDROP_MAC_DND_UTIL_H_ | 6 #define UI_BASE_DRAGDROP_MAC_DND_UTIL_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "ui/base/ui_export.h" | 13 #include "ui/base/ui_export.h" |
14 | 14 |
15 class GURL; | 15 class GURL; |
16 | 16 |
17 namespace ui { | 17 namespace ui { |
18 | 18 |
19 // Dummy data type that Chrome places in dragging pasteboards. There is never | 19 // Dummy data type that Chrome places in dragging pasteboards. There is never |
20 // any data associated with this type; it's only used to ensure that Chrome | 20 // any data associated with this type; it's only used to ensure that Chrome |
21 // supports any drag initiated inside of Chrome, whether or not data has been | 21 // supports any drag initiated inside of Chrome, whether or not data has been |
22 // associated with it. | 22 // associated with it. |
23 UI_EXPORT extern NSString* const kChromeDragDummyPboardType; | 23 UI_EXPORT extern NSString* const kChromeDragDummyPboardType; |
24 | 24 |
| 25 // Mail.app and TextEdit accept drags that have both HTML and image flavors on |
| 26 // them, but don't process them correctly <http://crbug.com/55879>. Therefore, |
| 27 // if there is an image flavor, don't put the HTML data on as HTML, but rather |
| 28 // put it on as this Chrome-only flavor. External apps won't see HTML but |
| 29 // Chrome will know enough to read it as HTML. <http://crbug.com/55879> |
| 30 UI_EXPORT extern NSString* const kChromeDragImageHTMLPboardType; |
| 31 |
25 // Populates the |url| and |title| with URL data in |pboard|. There may be more | 32 // Populates the |url| and |title| with URL data in |pboard|. There may be more |
26 // than one, but we only handle dropping the first. |url| must not be |NULL|; | 33 // than one, but we only handle dropping the first. |url| must not be |NULL|; |
27 // |title| is an optional parameter. Returns |YES| if URL data was obtained from | 34 // |title| is an optional parameter. Returns |YES| if URL data was obtained from |
28 // the pasteboard, |NO| otherwise. If |convert_filenames| is |YES|, the function | 35 // the pasteboard, |NO| otherwise. If |convert_filenames| is |YES|, the function |
29 // will also attempt to convert filenames in |pboard| to file URLs. | 36 // will also attempt to convert filenames in |pboard| to file URLs. |
30 UI_EXPORT BOOL PopulateURLAndTitleFromPasteboard(GURL* url, | 37 UI_EXPORT BOOL PopulateURLAndTitleFromPasteboard(GURL* url, |
31 string16* title, | 38 string16* title, |
32 NSPasteboard* pboard, | 39 NSPasteboard* pboard, |
33 BOOL convert_filenames); | 40 BOOL convert_filenames); |
34 | 41 |
35 } // namespace ui | 42 } // namespace ui |
36 | 43 |
37 #endif // UI_BASE_DRAGDROP_MAC_DND_UTIL_H_ | 44 #endif // UI_BASE_DRAGDROP_MAC_DND_UTIL_H_ |
OLD | NEW |