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 |
225 void Clipboard::ReadBookmark(string16* title, std::string* url) const { | 233 void Clipboard::ReadBookmark(string16* title, std::string* url) const { |
226 NSPasteboard* pb = GetPasteboard(); | 234 NSPasteboard* pb = GetPasteboard(); |
227 | 235 |
228 if (title) { | 236 if (title) { |
229 NSString* contents = [pb stringForType:kUTTypeURLName]; | 237 NSString* contents = [pb stringForType:kUTTypeURLName]; |
230 UTF8ToUTF16([contents UTF8String], | 238 UTF8ToUTF16([contents UTF8String], |
231 [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], | 239 [contents lengthOfBytesUsingEncoding:NSUTF8StringEncoding], |
232 title); | 240 title); |
233 } | 241 } |
234 | 242 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 332 } |
325 | 333 |
326 // static | 334 // static |
327 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { | 335 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { |
328 static const std::string type = | 336 static const std::string type = |
329 base::SysNSStringToUTF8(kWebSmartPastePboardType); | 337 base::SysNSStringToUTF8(kWebSmartPastePboardType); |
330 return type; | 338 return type; |
331 } | 339 } |
332 | 340 |
333 } // namespace ui | 341 } // namespace ui |
OLD | NEW |