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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/clipboard.h ('k') | base/clipboard_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/clipboard.cc
===================================================================
--- base/clipboard.cc (revision 0)
+++ base/clipboard.cc (revision 0)
@@ -0,0 +1,55 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Many of these functions are based on those found in
+// webkit/port/platform/PasteboardWin.cpp
+
+#include "base/clipboard.h"
+
+#include "base/logging.h"
+
+void Clipboard::DispatchObject(ObjectType type, const ObjectMapParams& params) {
+ switch (type) {
+ case CBF_TEXT:
+ WriteText(&(params[0].front()), params[0].size());
+ break;
+
+ case CBF_HTML:
+ if (params.size() == 2)
+ WriteHTML(&(params[0].front()), params[0].size(),
+ &(params[1].front()), params[1].size());
+ else
+ WriteHTML(&(params[0].front()), params[0].size(), NULL, 0);
+ break;
+
+#if defined(OS_WIN) || defined(OS_MACOSX)
+ case CBF_BOOKMARK:
+ WriteBookmark(&(params[0].front()), params[0].size(),
+ &(params[1].front()), params[1].size());
+ break;
+
+ case CBF_LINK:
+ WriteHyperlink(&(params[0].front()), params[0].size(),
+ &(params[1].front()), params[1].size());
+ break;
+
+ case CBF_FILES:
+ WriteFiles(&(params[0].front()), params[0].size());
+ break;
+#endif // defined(OS_WIN) || defined(OS_MACOSX)
+
+#if defined(OS_WIN)
+ case CBF_WEBKIT:
+ WriteWebSmartPaste();
+ break;
+
+ case CBF_BITMAP:
+ WriteBitmap(&(params[0].front()), &(params[1].front()));
+ break;
+#endif // defined(OS_WIN)
+
+ default:
+ NOTREACHED();
+ }
+}
« 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