OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Many of these functions are based on those found in |
| 6 // webkit/port/platform/PasteboardWin.cpp |
| 7 |
| 8 #include "base/clipboard.h" |
| 9 |
| 10 #include "base/logging.h" |
| 11 |
| 12 void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) { |
| 13 switch (type) { |
| 14 case CBF_TEXT: |
| 15 WriteText(&(params[0].front()), params[0].size()); |
| 16 break; |
| 17 |
| 18 case CBF_HTML: |
| 19 if (params.size() == 2) |
| 20 WriteHTML(&(params[0].front()), params[0].size(), |
| 21 &(params[1].front()), params[1].size()); |
| 22 else |
| 23 WriteHTML(&(params[0].front()), params[0].size(), NULL, 0); |
| 24 break; |
| 25 |
| 26 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 27 case CBF_BOOKMARK: |
| 28 WriteBookmark(&(params[0].front()), params[0].size(), |
| 29 &(params[1].front()), params[1].size()); |
| 30 break; |
| 31 |
| 32 case CBF_LINK: |
| 33 WriteHyperlink(&(params[0].front()), params[0].size(), |
| 34 &(params[1].front()), params[1].size()); |
| 35 break; |
| 36 |
| 37 case CBF_FILES: |
| 38 WriteFiles(&(params[0].front()), params[0].size()); |
| 39 break; |
| 40 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 41 |
| 42 #if defined(OS_WIN) |
| 43 case CBF_WEBKIT: |
| 44 WriteWebSmartPaste(); |
| 45 break; |
| 46 |
| 47 case CBF_BITMAP: |
| 48 WriteBitmap(&(params[0].front()), &(params[1].front())); |
| 49 break; |
| 50 #endif // defined(OS_WIN) |
| 51 |
| 52 default: |
| 53 NOTREACHED(); |
| 54 } |
| 55 } |
OLD | NEW |