OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/clipboard/clipboard.h" | 5 #include "ui/base/clipboard/clipboard.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 UTF8ToUTF16([contents UTF8String], | 215 UTF8ToUTF16([contents UTF8String], |
216 [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], | 216 [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], |
217 markup); | 217 markup); |
218 } | 218 } |
219 | 219 |
220 // TODO(avi): src_url? | 220 // TODO(avi): src_url? |
221 if (src_url) | 221 if (src_url) |
222 src_url->clear(); | 222 src_url->clear(); |
223 } | 223 } |
224 | 224 |
225 void Clipboard::ReadImage(Buffer buffer, std::string* data) const { | |
226 DCHECK_EQ(buffer, BUFFER_STANDARD); | |
227 if (!data) { | |
228 NOTREACHED(); | |
229 return; | |
230 } | |
231 } | |
232 | |
233 void Clipboard::ReadBookmark(string16* title, std::string* url) const { | 225 void Clipboard::ReadBookmark(string16* title, std::string* url) const { |
234 NSPasteboard* pb = GetPasteboard(); | 226 NSPasteboard* pb = GetPasteboard(); |
235 | 227 |
236 if (title) { | 228 if (title) { |
237 NSString* contents = [pb stringForType:kUTTypeURLName]; | 229 NSString* contents = [pb stringForType:kUTTypeURLName]; |
238 UTF8ToUTF16([contents UTF8String], | 230 UTF8ToUTF16([contents UTF8String], |
239 [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], | 231 [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], |
240 title); | 232 title); |
241 } | 233 } |
242 | 234 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 } | 324 } |
333 | 325 |
334 // static | 326 // static |
335 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { | 327 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { |
336 static const std::string type = | 328 static const std::string type = |
337 base::SysNSStringToUTF8(kWebSmartPastePboardType); | 329 base::SysNSStringToUTF8(kWebSmartPastePboardType); |
338 return type; | 330 return type; |
339 } | 331 } |
340 | 332 |
341 } // namespace ui | 333 } // namespace ui |
OLD | NEW |