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 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
10 #include "ui/gfx/linux_util.h" | 10 #include "ui/gfx/linux_util.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 *pixel = (bitmap[byte_counter] << 0) + /* R */ | 233 *pixel = (bitmap[byte_counter] << 0) + /* R */ |
234 (bitmap[byte_counter + 1] << 8) + /* G */ | 234 (bitmap[byte_counter + 1] << 8) + /* G */ |
235 (bitmap[byte_counter + 2] << 16) + /* B */ | 235 (bitmap[byte_counter + 2] << 16) + /* B */ |
236 (bitmap[byte_counter + 3] << 24); /* A */ | 236 (bitmap[byte_counter + 3] << 24); /* A */ |
237 byte_counter += 4; | 237 byte_counter += 4; |
238 } | 238 } |
239 } | 239 } |
240 return image; | 240 return image; |
241 } | 241 } |
242 | 242 |
243 void Clipboard::ReadCustomData(Buffer buffer, | |
244 const string16& data, | |
245 string16* data) const { | |
246 // TODO(dcheng): Implement this. | |
tony
2011/12/02 00:13:29
Nit: Should we add a NOTIMPLEMENTED()?
dcheng
2011/12/02 00:29:17
Done.
| |
247 } | |
248 | |
243 void Clipboard::ReadBookmark(string16* title, std::string* url) const { | 249 void Clipboard::ReadBookmark(string16* title, std::string* url) const { |
244 *title = UTF8ToUTF16(GetClipboardData()->bookmark_title()); | 250 *title = UTF8ToUTF16(GetClipboardData()->bookmark_title()); |
245 *url = GetClipboardData()->bookmark_url(); | 251 *url = GetClipboardData()->bookmark_url(); |
246 } | 252 } |
247 | 253 |
248 void Clipboard::ReadFile(FilePath* file) const { | 254 void Clipboard::ReadFile(FilePath* file) const { |
249 NOTIMPLEMENTED(); | 255 NOTIMPLEMENTED(); |
250 } | 256 } |
251 | 257 |
252 void Clipboard::ReadFiles(std::vector<FilePath>* files) const { | 258 void Clipboard::ReadFiles(std::vector<FilePath>* files) const { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 Clipboard::FormatType Clipboard::GetBitmapFormatType() { | 324 Clipboard::FormatType Clipboard::GetBitmapFormatType() { |
319 return std::string(kMimeTypeBitmap); | 325 return std::string(kMimeTypeBitmap); |
320 } | 326 } |
321 | 327 |
322 // static | 328 // static |
323 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { | 329 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { |
324 return std::string(kMimeTypeWebkitSmartPaste); | 330 return std::string(kMimeTypeWebkitSmartPaste); |
325 } | 331 } |
326 | 332 |
327 } // namespace ui | 333 } // namespace ui |
OLD | NEW |