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

Unified Diff: webkit/glue/simple_clipboard_impl.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 | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/simple_clipboard_impl.cc
===================================================================
--- webkit/glue/simple_clipboard_impl.cc (revision 4189)
+++ webkit/glue/simple_clipboard_impl.cc (working copy)
@@ -7,47 +7,33 @@
#include <string>
#include "base/clipboard.h"
+#include "webkit/glue/scoped_clipboard_writer_glue.h"
#include "googleurl/src/gurl.h"
#include "SkBitmap.h"
// Clipboard glue
-// Basically just proxy the calls off to the clipboard
-namespace webkit_glue {
-
-Clipboard clipboard;
-
-void ClipboardClear() {
- clipboard.Clear();
+#if defined(OS_WIN)
+// The call is being made within the current process.
+void ScopedClipboardWriterGlue::WriteBitmap(const SkBitmap& bitmap) {
+ SkAutoLockPixels bitmap_lock(bitmap);
+ WriteBitmapFromPixels(bitmap.getPixels(), gfx::Size(bitmap.width(),
+ bitmap.height()));
}
+#endif // defined(OS_WIN)
-void ClipboardWriteText(const std::wstring& text) {
- clipboard.WriteText(text);
+ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
}
-void ClipboardWriteHTML(const std::wstring& html,
- const GURL& url) {
- clipboard.WriteHTML(html, url.spec());
-}
+namespace webkit_glue {
-void ClipboardWriteBookmark(const std::wstring& title,
- const GURL& url) {
- clipboard.WriteBookmark(title, url.spec());
-}
+Clipboard clipboard;
-#if defined(OS_WIN)
-void ClipboardWriteBitmap(const SkBitmap& bitmap) {
- SkAutoLockPixels bitmap_lock(bitmap);
- clipboard.WriteBitmap(bitmap.getPixels(),
- gfx::Size(bitmap.width(), bitmap.height()));
+Clipboard* ClipboardGetClipboard() {
+ return &clipboard;
}
-void ClipboardWriteWebSmartPaste() {
- clipboard.WriteWebSmartPaste();
-}
-#endif
-
bool ClipboardIsFormatAvailable(Clipboard::FormatType format) {
return clipboard.IsFormatAvailable(format);
}
@@ -68,4 +54,3 @@
}
} // namespace webkit_glue
-
« no previous file with comments | « webkit/glue/scoped_clipboard_writer_glue.h ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698