Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: base/clipboard.cc

Issue 9154: Rewrote the clipboard API to be more concurrent. Added a helper class to make... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/clipboard.h ('k') | base/clipboard_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « base/clipboard.h ('k') | base/clipboard_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698