| 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 #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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 if (currentRVH_ != webContents_->GetRenderViewHost()) | 209 if (currentRVH_ != webContents_->GetRenderViewHost()) |
| 210 [self draggingEntered:info view:view]; | 210 [self draggingEntered:info view:view]; |
| 211 | 211 |
| 212 // Check if we only allow navigation and navigate to a url on the pasteboard. | 212 // Check if we only allow navigation and navigate to a url on the pasteboard. |
| 213 if ([self onlyAllowsNavigation]) { | 213 if ([self onlyAllowsNavigation]) { |
| 214 NSPasteboard* pboard = [info draggingPasteboard]; | 214 NSPasteboard* pboard = [info draggingPasteboard]; |
| 215 if ([pboard containsURLData]) { | 215 if ([pboard containsURLData]) { |
| 216 GURL url; | 216 GURL url; |
| 217 ui::PopulateURLAndTitleFromPasteboard(&url, NULL, pboard, YES); | 217 ui::PopulateURLAndTitleFromPasteboard(&url, NULL, pboard, YES); |
| 218 webContents_->OpenURL(OpenURLParams( | 218 webContents_->OpenURL(OpenURLParams( |
| 219 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_AUTO_BOOKMARK, | 219 url, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_AUTO_BOOKMARK, |
| 220 false)); | 220 false)); |
| 221 return YES; | 221 return YES; |
| 222 } else { | 222 } else { |
| 223 return NO; | 223 return NO; |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 if (delegate_) | 227 if (delegate_) |
| 228 delegate_->OnDrop(); | 228 delegate_->OnDrop(); |
| 229 | 229 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 // Get custom MIME data. | 304 // Get custom MIME data. |
| 305 if ([types containsObject:ui::kWebCustomDataPboardType]) { | 305 if ([types containsObject:ui::kWebCustomDataPboardType]) { |
| 306 NSData* customData = [pboard dataForType:ui::kWebCustomDataPboardType]; | 306 NSData* customData = [pboard dataForType:ui::kWebCustomDataPboardType]; |
| 307 ui::ReadCustomDataIntoMap([customData bytes], | 307 ui::ReadCustomDataIntoMap([customData bytes], |
| 308 [customData length], | 308 [customData length], |
| 309 &data->custom_data); | 309 &data->custom_data); |
| 310 } | 310 } |
| 311 } | 311 } |
| 312 | 312 |
| 313 @end | 313 @end |
| OLD | NEW |