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

Unified Diff: webkit/tools/test_shell/simple_clipboard_impl.cc

Issue 8591030: Move clipboard-related webkit_glue embedder functions into a ClipboardClient interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 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/tools/test_shell/simple_clipboard_impl.h ('k') | webkit/tools/test_shell/test_shell_webkit_init.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/simple_clipboard_impl.cc
diff --git a/webkit/tools/test_shell/simple_clipboard_impl.cc b/webkit/tools/test_shell/simple_clipboard_impl.cc
index 2b4219f7980d106b59b52d9e21b63e63100adde7..0b137f1caf14bf30056dca5408d46cbbd2102882 100644
--- a/webkit/tools/test_shell/simple_clipboard_impl.cc
+++ b/webkit/tools/test_shell/simple_clipboard_impl.cc
@@ -2,7 +2,7 @@
// 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 "webkit/tools/test_shell/simple_clipboard_impl.h"
#include <string>
@@ -15,62 +15,66 @@
#include "ui/base/clipboard/clipboard.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/size.h"
-#include "webkit/glue/scoped_clipboard_writer_glue.h"
+#include "webkit/glue/webkit_glue.h"
-// Clipboard glue
+namespace {
-void ScopedClipboardWriterGlue::WriteBitmapFromPixels(
- const void* pixels, const gfx::Size& size) {
- ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size);
-}
+base::LazyInstance<ui::Clipboard> clipboard = LAZY_INSTANCE_INITIALIZER;
+
+} // anonymous namespace
-ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
+SimpleClipboardClient::SimpleClipboardClient() {
}
-namespace webkit_glue {
+SimpleClipboardClient::~SimpleClipboardClient() {
+}
-base::LazyInstance<ui::Clipboard> clipboard = LAZY_INSTANCE_INITIALIZER;
-ui::Clipboard* ClipboardGetClipboard() {
+ui::Clipboard* SimpleClipboardClient::GetClipboard() {
return clipboard.Pointer();
}
-uint64 ClipboardGetSequenceNumber(ui::Clipboard::Buffer buffer) {
- return ClipboardGetClipboard()->GetSequenceNumber(buffer);
+uint64 SimpleClipboardClient::GetSequenceNumber(ui::Clipboard::Buffer buffer) {
+ return GetClipboard()->GetSequenceNumber(buffer);
}
-bool ClipboardIsFormatAvailable(const ui::Clipboard::FormatType& format,
- ui::Clipboard::Buffer buffer) {
- return ClipboardGetClipboard()->IsFormatAvailable(format, buffer);
+bool SimpleClipboardClient::IsFormatAvailable(
+ const ui::Clipboard::FormatType& format,
+ ui::Clipboard::Buffer buffer) {
+ return GetClipboard()->IsFormatAvailable(format, buffer);
}
-void ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer,
- std::vector<string16>* types,
- bool* contains_filenames) {
- return ClipboardGetClipboard()->ReadAvailableTypes(buffer, types,
+void SimpleClipboardClient::ReadAvailableTypes(ui::Clipboard::Buffer buffer,
+ std::vector<string16>* types,
+ bool* contains_filenames) {
+ return GetClipboard()->ReadAvailableTypes(buffer, types,
contains_filenames);
}
-void ClipboardReadText(ui::Clipboard::Buffer buffer, string16* result) {
- ClipboardGetClipboard()->ReadText(buffer, result);
+void SimpleClipboardClient::ReadText(ui::Clipboard::Buffer buffer,
+ string16* result) {
+ GetClipboard()->ReadText(buffer, result);
}
-void ClipboardReadAsciiText(ui::Clipboard::Buffer buffer, std::string* result) {
- ClipboardGetClipboard()->ReadAsciiText(buffer, result);
+void SimpleClipboardClient::ReadAsciiText(ui::Clipboard::Buffer buffer,
+ std::string* result) {
+ GetClipboard()->ReadAsciiText(buffer, result);
}
-void ClipboardReadHTML(ui::Clipboard::Buffer buffer, string16* markup,
- GURL* url, uint32* fragment_start,
- uint32* fragment_end) {
+void SimpleClipboardClient::ReadHTML(ui::Clipboard::Buffer buffer,
+ string16* markup,
+ GURL* url, uint32* fragment_start,
+ uint32* fragment_end) {
std::string url_str;
- ClipboardGetClipboard()->ReadHTML(buffer, markup, url ? &url_str : NULL,
- fragment_start, fragment_end);
+ GetClipboard()->ReadHTML(buffer, markup, url ? &url_str : NULL,
+ fragment_start, fragment_end);
if (url)
*url = GURL(url_str);
}
-void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data) {
- SkBitmap bitmap = ClipboardGetClipboard()->ReadImage(buffer);
+void SimpleClipboardClient::ReadImage(ui::Clipboard::Buffer buffer,
+ std::string* data) {
+ SkBitmap bitmap = GetClipboard()->ReadImage(buffer);
if (bitmap.isNull())
return;
@@ -90,4 +94,8 @@ void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data) {
}
}
-} // namespace webkit_glue
+webkit_glue::ClipboardClient::WriteContext*
+SimpleClipboardClient::CreateWriteContext() {
+ return NULL;
+}
+
« no previous file with comments | « webkit/tools/test_shell/simple_clipboard_impl.h ('k') | webkit/tools/test_shell/test_shell_webkit_init.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698