From 756e2592f1cecf13e8ea2eea902780a7cddf0242 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Wed, 29 Apr 2009 22:59:35 +0000 Subject: 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 --- webkit/glue/simple_clipboard_impl.cc | 56 ---------------------- webkit/tools/test_shell/simple_clipboard_impl.cc | 56 ++++++++++++++++++++++ webkit/tools/test_shell/test_shell.gyp | 9 +--- webkit/tools/test_shell/test_shell.vcproj | 2 +- webkit/tools/test_shell/test_shell_tests.vcproj | 2 +- .../test_shell/test_worker/test_worker.vcproj | 2 +- webkit/webkit.gyp | 3 -- 7 files changed, 60 insertions(+), 70 deletions(-) delete mode 100644 webkit/glue/simple_clipboard_impl.cc create mode 100644 webkit/tools/test_shell/simple_clipboard_impl.cc (limited to 'webkit') diff --git a/webkit/glue/simple_clipboard_impl.cc b/webkit/glue/simple_clipboard_impl.cc deleted file mode 100644 index 264dfa5..0000000 --- a/webkit/glue/simple_clipboard_impl.cc +++ /dev/null @@ -1,56 +0,0 @@ -// 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 - -#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(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/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 + +#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(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 @@ >