Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Side by Side Diff: content/browser/web_contents/web_drag_dest_mac.mm

Issue 13758002: Fix dropping images into content editable divs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/web_contents/web_drag_source_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import "content/browser/web_contents/web_drag_dest_mac.h" 5 #import "content/browser/web_contents/web_drag_dest_mac.h"
6 6
7 #import <Carbon/Carbon.h> 7 #import <Carbon/Carbon.h>
8 8
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 // Get plain text. 242 // Get plain text.
243 if ([types containsObject:NSStringPboardType]) { 243 if ([types containsObject:NSStringPboardType]) {
244 data->text = NullableString16( 244 data->text = NullableString16(
245 base::SysNSStringToUTF16([pboard stringForType:NSStringPboardType]), 245 base::SysNSStringToUTF16([pboard stringForType:NSStringPboardType]),
246 false); 246 false);
247 } 247 }
248 248
249 // Get HTML. If there's no HTML, try RTF. 249 // Get HTML. If there's no HTML, try RTF.
250 if ([types containsObject:NSHTMLPboardType]) { 250 if ([types containsObject:NSHTMLPboardType]) {
251 data->html = NullableString16( 251 NSString* html = [pboard stringForType:NSHTMLPboardType];
252 base::SysNSStringToUTF16([pboard stringForType:NSHTMLPboardType]), 252 data->html = NullableString16(base::SysNSStringToUTF16(html), false);
253 false); 253 } else if ([types containsObject:ui::kChromeDragImageHTMLPboardType]) {
254 NSString* html = [pboard stringForType:ui::kChromeDragImageHTMLPboardType];
255 data->html = NullableString16(base::SysNSStringToUTF16(html), false);
254 } else if ([types containsObject:NSRTFPboardType]) { 256 } else if ([types containsObject:NSRTFPboardType]) {
255 NSString* html = [pboard htmlFromRtf]; 257 NSString* html = [pboard htmlFromRtf];
256 data->html = NullableString16(base::SysNSStringToUTF16(html), false); 258 data->html = NullableString16(base::SysNSStringToUTF16(html), false);
257 } 259 }
258 260
259 // Get files. 261 // Get files.
260 if ([types containsObject:NSFilenamesPboardType]) { 262 if ([types containsObject:NSFilenamesPboardType]) {
261 NSArray* files = [pboard propertyListForType:NSFilenamesPboardType]; 263 NSArray* files = [pboard propertyListForType:NSFilenamesPboardType];
262 if ([files isKindOfClass:[NSArray class]] && [files count]) { 264 if ([files isKindOfClass:[NSArray class]] && [files count]) {
263 for (NSUInteger i = 0; i < [files count]; i++) { 265 for (NSUInteger i = 0; i < [files count]; i++) {
(...skipping 14 matching lines...) Expand all
278 // Get custom MIME data. 280 // Get custom MIME data.
279 if ([types containsObject:ui::kWebCustomDataPboardType]) { 281 if ([types containsObject:ui::kWebCustomDataPboardType]) {
280 NSData* customData = [pboard dataForType:ui::kWebCustomDataPboardType]; 282 NSData* customData = [pboard dataForType:ui::kWebCustomDataPboardType];
281 ui::ReadCustomDataIntoMap([customData bytes], 283 ui::ReadCustomDataIntoMap([customData bytes],
282 [customData length], 284 [customData length],
283 &data->custom_data); 285 &data->custom_data);
284 } 286 }
285 } 287 }
286 288
287 @end 289 @end
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_drag_source_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698