| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ui/base/dragdrop/os_exchange_data_provider_mac.h" | 5 #include "ui/base/dragdrop/os_exchange_data_provider_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 return [[pasteboard_->get() types] containsObject:format.ToNSString()]; | 174 return [[pasteboard_->get() types] containsObject:format.ToNSString()]; |
| 175 } | 175 } |
| 176 | 176 |
| 177 void OSExchangeDataProviderMac::SetDragImage( | 177 void OSExchangeDataProviderMac::SetDragImage( |
| 178 const gfx::ImageSkia& image, | 178 const gfx::ImageSkia& image, |
| 179 const gfx::Vector2d& cursor_offset) { | 179 const gfx::Vector2d& cursor_offset) { |
| 180 drag_image_ = image; | 180 drag_image_ = image; |
| 181 cursor_offset_ = cursor_offset; | 181 cursor_offset_ = cursor_offset; |
| 182 } | 182 } |
| 183 | 183 |
| 184 const gfx::ImageSkia& OSExchangeDataProviderMac::GetDragImage() const { | 184 gfx::ImageSkia OSExchangeDataProviderMac::GetDragImage() const { |
| 185 return drag_image_; | 185 return drag_image_; |
| 186 } | 186 } |
| 187 | 187 |
| 188 const gfx::Vector2d& OSExchangeDataProviderMac::GetDragImageOffset() const { | 188 gfx::Vector2d OSExchangeDataProviderMac::GetDragImageOffset() const { |
| 189 return cursor_offset_; | 189 return cursor_offset_; |
| 190 } | 190 } |
| 191 | 191 |
| 192 NSData* OSExchangeDataProviderMac::GetNSDataForType(NSString* type) const { | 192 NSData* OSExchangeDataProviderMac::GetNSDataForType(NSString* type) const { |
| 193 return [pasteboard_->get() dataForType:type]; | 193 return [pasteboard_->get() dataForType:type]; |
| 194 } | 194 } |
| 195 | 195 |
| 196 // static | 196 // static |
| 197 std::unique_ptr<OSExchangeData> | 197 std::unique_ptr<OSExchangeData> |
| 198 OSExchangeDataProviderMac::CreateDataFromPasteboard(NSPasteboard* pasteboard) { | 198 OSExchangeDataProviderMac::CreateDataFromPasteboard(NSPasteboard* pasteboard) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 209 NSArray* OSExchangeDataProviderMac::SupportedPasteboardTypes() { | 209 NSArray* OSExchangeDataProviderMac::SupportedPasteboardTypes() { |
| 210 return @[ | 210 return @[ |
| 211 kWebCustomDataPboardType, ui::ClipboardUtil::UTIForWebURLsAndTitles(), | 211 kWebCustomDataPboardType, ui::ClipboardUtil::UTIForWebURLsAndTitles(), |
| 212 NSURLPboardType, NSFilenamesPboardType, ui::kChromeDragDummyPboardType, | 212 NSURLPboardType, NSFilenamesPboardType, ui::kChromeDragDummyPboardType, |
| 213 NSStringPboardType, NSHTMLPboardType, NSRTFPboardType, | 213 NSStringPboardType, NSHTMLPboardType, NSRTFPboardType, |
| 214 NSFilenamesPboardType, ui::kWebCustomDataPboardType, NSPasteboardTypeString | 214 NSFilenamesPboardType, ui::kWebCustomDataPboardType, NSPasteboardTypeString |
| 215 ]; | 215 ]; |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace ui | 218 } // namespace ui |
| OLD | NEW |