summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-29 22:59:35 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-29 22:59:35 +0000
commit756e2592f1cecf13e8ea2eea902780a7cddf0242 (patch)
treed484269a2da7d58826e2388857dc5ed7853bdb93 /webkit/tools
parent4b1e481a012e148819cfe3ed4023906b47b38282 (diff)
downloadchromium_src-756e2592f1cecf13e8ea2eea902780a7cddf0242.zip
chromium_src-756e2592f1cecf13e8ea2eea902780a7cddf0242.tar.gz
chromium_src-756e2592f1cecf13e8ea2eea902780a7cddf0242.tar.bz2
Move simple_clipboard_impl.cc to webkit/tools/test_shell where it belongs.
Review URL: http://codereview.chromium.org/100144 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14909 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/test_shell/simple_clipboard_impl.cc56
-rw-r--r--webkit/tools/test_shell/test_shell.gyp9
-rw-r--r--webkit/tools/test_shell/test_shell.vcproj2
-rw-r--r--webkit/tools/test_shell/test_shell_tests.vcproj2
-rw-r--r--webkit/tools/test_shell/test_worker/test_worker.vcproj2
5 files changed, 60 insertions, 11 deletions
diff --git a/webkit/tools/test_shell/simple_clipboard_impl.cc b/webkit/tools/test_shell/simple_clipboard_impl.cc
new file mode 100644
index 0000000..264dfa5
--- /dev/null
+++ b/webkit/tools/test_shell/simple_clipboard_impl.cc
@@ -0,0 +1,56 @@
+// 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.
+
+#include "webkit/glue/webkit_glue.h"
+
+#include <string>
+
+#include "base/clipboard.h"
+#include "base/lazy_instance.h"
+#include "base/string16.h"
+#include "googleurl/src/gurl.h"
+#include "webkit/glue/scoped_clipboard_writer_glue.h"
+
+#include "SkBitmap.h"
+
+// Clipboard glue
+
+#if defined(OS_WIN)
+void ScopedClipboardWriterGlue::WriteBitmapFromPixels(
+ const void* pixels, const gfx::Size& size) {
+ ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size);
+}
+#endif
+
+ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
+}
+
+namespace webkit_glue {
+
+base::LazyInstance<Clipboard> clipboard(base::LINKER_INITIALIZED);
+
+Clipboard* ClipboardGetClipboard() {
+ return clipboard.Pointer();
+}
+
+bool ClipboardIsFormatAvailable(const Clipboard::FormatType& format) {
+ return ClipboardGetClipboard()->IsFormatAvailable(format);
+}
+
+void ClipboardReadText(string16* result) {
+ ClipboardGetClipboard()->ReadText(result);
+}
+
+void ClipboardReadAsciiText(std::string* result) {
+ ClipboardGetClipboard()->ReadAsciiText(result);
+}
+
+void ClipboardReadHTML(string16* markup, GURL* url) {
+ std::string url_str;
+ ClipboardGetClipboard()->ReadHTML(markup, url ? &url_str : NULL);
+ if (url)
+ *url = GURL(url_str);
+}
+
+} // namespace webkit_glue
diff --git a/webkit/tools/test_shell/test_shell.gyp b/webkit/tools/test_shell/test_shell.gyp
index 9c916f6..f660ffe 100644
--- a/webkit/tools/test_shell/test_shell.gyp
+++ b/webkit/tools/test_shell/test_shell.gyp
@@ -39,13 +39,6 @@
'../../webkit.gyp:webkit',
],
'sources': [
- # TODO: Clean this up.
- # An alternate implementation for chrome on windows lives in:
- # chrome/renderer/renderer_glue.cc
- # As a consequence this can't be baked directly into glue.
- # This version is needed for test_shell and test_shell_tests so
- # it gets baked into test_shell_common for now.
- '../../glue/simple_clipboard_impl.cc',
'mac/DumpRenderTreePasteboard.h',
'mac/DumpRenderTreePasteboard.m',
'mac/test_shell_webview.h',
@@ -65,6 +58,7 @@
'mock_webclipboard_impl.cc',
'mock_webclipboard_impl.h',
'resource.h',
+ 'simple_clipboard_impl.cc',
'simple_resource_loader_bridge.cc',
'simple_resource_loader_bridge.h',
'test_navigation_controller.cc',
@@ -152,7 +146,6 @@
'sources!': [
'drag_delegate.cc',
'drop_delegate.cc',
- '../../glue/simple_clipboard_impl.cc',
],
}],
],
diff --git a/webkit/tools/test_shell/test_shell.vcproj b/webkit/tools/test_shell/test_shell.vcproj
index 7169a9b..9525a72 100644
--- a/webkit/tools/test_shell/test_shell.vcproj
+++ b/webkit/tools/test_shell/test_shell.vcproj
@@ -250,7 +250,7 @@
>
</File>
<File
- RelativePath="..\..\glue\simple_clipboard_impl.cc"
+ RelativePath=".\simple_clipboard_impl.cc"
>
</File>
<File
diff --git a/webkit/tools/test_shell/test_shell_tests.vcproj b/webkit/tools/test_shell/test_shell_tests.vcproj
index 432f101..e4da9ba 100644
--- a/webkit/tools/test_shell/test_shell_tests.vcproj
+++ b/webkit/tools/test_shell/test_shell_tests.vcproj
@@ -203,7 +203,7 @@
>
</File>
<File
- RelativePath="..\..\glue\simple_clipboard_impl.cc"
+ RelativePath=".\simple_clipboard_impl.cc"
>
</File>
<File
diff --git a/webkit/tools/test_shell/test_worker/test_worker.vcproj b/webkit/tools/test_shell/test_worker/test_worker.vcproj
index d9f6997..4634b70 100644
--- a/webkit/tools/test_shell/test_worker/test_worker.vcproj
+++ b/webkit/tools/test_shell/test_worker/test_worker.vcproj
@@ -141,7 +141,7 @@
</References>
<Files>
<File
- RelativePath="..\..\..\glue\simple_clipboard_impl.cc"
+ RelativePath="..\simple_clipboard_impl.cc"
>
</File>
<File