diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 18:16:44 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 18:16:44 +0000 |
commit | 36780a15c5a9d7d7d1fa34f982a71d6072415e4a (patch) | |
tree | 167309420331862eb9b105d9a927e0ef0da90658 /webkit | |
parent | 0c52d8f310ef416feeb0ef79533b2d76ac19d972 (diff) | |
download | chromium_src-36780a15c5a9d7d7d1fa34f982a71d6072415e4a.zip chromium_src-36780a15c5a9d7d7d1fa34f982a71d6072415e4a.tar.gz chromium_src-36780a15c5a9d7d7d1fa34f982a71d6072415e4a.tar.bz2 |
Remove unused clipboard methods.
BUG=none
TEST=chrome, test_shell, and DumpRenderTree all still compile.
Review URL: http://codereview.chromium.org/8446011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108683 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webclipboard_impl.cc | 59 | ||||
-rw-r--r-- | webkit/glue/webclipboard_impl.h | 14 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.h | 14 | ||||
-rw-r--r-- | webkit/tools/test_shell/mock_webclipboard_impl.cc | 32 | ||||
-rw-r--r-- | webkit/tools/test_shell/mock_webclipboard_impl.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/simple_clipboard_impl.cc | 22 |
6 files changed, 44 insertions, 101 deletions
diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc index 91876c6..888de27 100644 --- a/webkit/glue/webclipboard_impl.cc +++ b/webkit/glue/webclipboard_impl.cc @@ -63,6 +63,10 @@ std::string WebClipboardImpl::URLToImageMarkup(const WebURL& url, WebClipboardImpl::~WebClipboardImpl() { } +uint64 WebClipboardImpl::getSequenceNumber() { + return ClipboardGetSequenceNumber(); +} + bool WebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) { ui::Clipboard::FormatType format_type; ui::Clipboard::Buffer buffer_type; @@ -95,6 +99,16 @@ bool WebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) { return ClipboardIsFormatAvailable(format_type, buffer_type); } +WebVector<WebString> WebClipboardImpl::readAvailableTypes( + Buffer buffer, bool* contains_filenames) { + ui::Clipboard::Buffer buffer_type; + std::vector<string16> types; + if (ConvertBufferType(buffer, &buffer_type)) { + ClipboardReadAvailableTypes(buffer_type, &types, contains_filenames); + } + return types; +} + WebString WebClipboardImpl::readPlainText(Buffer buffer) { ui::Clipboard::Buffer buffer_type; if (!ConvertBufferType(buffer, &buffer_type)) @@ -145,10 +159,6 @@ WebData WebClipboardImpl::readImage(Buffer buffer) { return WebData(png_data); } -uint64 WebClipboardImpl::getSequenceNumber() { - return ClipboardGetSequenceNumber(); -} - void WebClipboardImpl::writeHTML( const WebString& html_text, const WebURL& source_url, const WebString& plain_text, bool write_smart_paste) { @@ -202,47 +212,6 @@ void WebClipboardImpl::writeImage( } } -void WebClipboardImpl::writeData(const WebString& type, - const WebString& data, - const WebString& metadata) { - // TODO(dcheng): Implement this stub. -} - -WebVector<WebString> WebClipboardImpl::readAvailableTypes( - Buffer buffer, bool* contains_filenames) { - ui::Clipboard::Buffer buffer_type; - std::vector<string16> types; - if (ConvertBufferType(buffer, &buffer_type)) { - ClipboardReadAvailableTypes(buffer_type, &types, contains_filenames); - } - return types; -} - -bool WebClipboardImpl::readData(Buffer buffer, const WebString& type, - WebString* data, WebString* metadata) { - ui::Clipboard::Buffer buffer_type; - if (!ConvertBufferType(buffer, &buffer_type)) - return false; - - string16 data_out; - string16 metadata_out; - bool result = ClipboardReadData(buffer_type, type, &data_out, &metadata_out); - if (result) { - *data = data_out; - *metadata = metadata_out; - } - return result; -} - -WebVector<WebString> WebClipboardImpl::readFilenames(Buffer buffer) { - ui::Clipboard::Buffer buffer_type; - std::vector<string16> filenames; - if (ConvertBufferType(buffer, &buffer_type)) { - ClipboardReadFilenames(buffer_type, &filenames); - } - return filenames; -} - bool WebClipboardImpl::ConvertBufferType(Buffer buffer, ui::Clipboard::Buffer* result) { switch (buffer) { diff --git a/webkit/glue/webclipboard_impl.h b/webkit/glue/webclipboard_impl.h index 7d1adb7..e0bc399 100644 --- a/webkit/glue/webclipboard_impl.h +++ b/webkit/glue/webclipboard_impl.h @@ -22,7 +22,10 @@ class WebClipboardImpl : public WebKit::WebClipboard { virtual ~WebClipboardImpl(); // WebClipboard methods: + virtual uint64 getSequenceNumber(); virtual bool isFormatAvailable(Format, Buffer); + virtual WebKit::WebVector<WebKit::WebString> readAvailableTypes( + Buffer, bool* contains_filenames); virtual WebKit::WebString readPlainText(Buffer); virtual WebKit::WebString readHTML( Buffer, @@ -30,7 +33,6 @@ class WebClipboardImpl : public WebKit::WebClipboard { unsigned* fragment_start, unsigned* fragment_end); virtual WebKit::WebData readImage(Buffer); - virtual uint64 getSequenceNumber(); virtual void writeHTML( const WebKit::WebString& html_text, const WebKit::WebURL& source_url, @@ -44,16 +46,6 @@ class WebClipboardImpl : public WebKit::WebClipboard { const WebKit::WebImage&, const WebKit::WebURL& source_url, const WebKit::WebString& title); - virtual void writeData( - const WebKit::WebString& type, - const WebKit::WebString& data, - const WebKit::WebString& metadata); - - virtual WebKit::WebVector<WebKit::WebString> readAvailableTypes( - Buffer, bool* contains_filenames); - virtual bool readData(Buffer, const WebKit::WebString& type, - WebKit::WebString* data, WebKit::WebString* metadata); - virtual WebKit::WebVector<WebKit::WebString> readFilenames(Buffer); private: bool ConvertBufferType(Buffer, ui::Clipboard::Buffer*); diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index 66ba1a5..e4a5ab0 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -173,6 +173,9 @@ base::StringPiece GetDataResource(int resource_id); // Get a clipboard that can be used to construct a ScopedClipboardWriterGlue. ui::Clipboard* ClipboardGetClipboard(); +// Get a sequence number which uniquely identifies clipboard state. +uint64 ClipboardGetSequenceNumber(); + // Tests whether the clipboard contains a certain format bool ClipboardIsFormatAvailable(const ui::Clipboard::FormatType& format, ui::Clipboard::Buffer buffer); @@ -195,17 +198,6 @@ void ClipboardReadHTML(ui::Clipboard::Buffer buffer, string16* markup, void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data); -// Reads one type of data from the clipboard, if available. -bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type, - string16* data, string16* metadata); - -// Get a sequence number which uniquely identifies clipboard state. -uint64 ClipboardGetSequenceNumber(); - -// Reads filenames from the clipboard, if available. -bool ClipboardReadFilenames(ui::Clipboard::Buffer buffer, - std::vector<string16>* filenames); - // Embedders implement this function to return the list of plugins to Webkit. void GetPlugins(bool refresh, std::vector<webkit::WebPluginInfo>* plugins); diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.cc b/webkit/tools/test_shell/mock_webclipboard_impl.cc index 8219985..e1b1253 100644 --- a/webkit/tools/test_shell/mock_webclipboard_impl.cc +++ b/webkit/tools/test_shell/mock_webclipboard_impl.cc @@ -61,6 +61,22 @@ bool MockWebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) { return true; } +WebVector<WebString> MockWebClipboardImpl::readAvailableTypes( + Buffer buffer, bool* containsFilenames) { + *containsFilenames = false; + std::vector<WebString> results; + if (!m_plainText.isEmpty()) { + results.push_back(WebString("text/plain")); + } + if (!m_htmlText.isEmpty()) { + results.push_back(WebString("text/html")); + } + if (!m_image.isNull()) { + results.push_back(WebString("image/png")); + } + return results; +} + WebKit::WebString MockWebClipboardImpl::readPlainText( WebKit::WebClipboard::Buffer buffer) { return m_plainText; @@ -142,19 +158,3 @@ void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image, m_writeSmartPaste = false; } } - -WebVector<WebString> MockWebClipboardImpl::readAvailableTypes( - Buffer buffer, bool* containsFilenames) { - *containsFilenames = false; - std::vector<WebString> results; - if (!m_plainText.isEmpty()) { - results.push_back(WebString("text/plain")); - } - if (!m_htmlText.isEmpty()) { - results.push_back(WebString("text/html")); - } - if (!m_image.isNull()) { - results.push_back(WebString("image/png")); - } - return results; -} diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.h b/webkit/tools/test_shell/mock_webclipboard_impl.h index e51b2b6..9123495 100644 --- a/webkit/tools/test_shell/mock_webclipboard_impl.h +++ b/webkit/tools/test_shell/mock_webclipboard_impl.h @@ -20,6 +20,8 @@ class MockWebClipboardImpl : public WebKit::WebClipboard { virtual bool isFormatAvailable(WebKit::WebClipboard::Format, WebKit::WebClipboard::Buffer); + virtual WebKit::WebVector<WebKit::WebString> readAvailableTypes( + WebKit::WebClipboard::Buffer, bool* containsFilenames); virtual WebKit::WebString readPlainText(WebKit::WebClipboard::Buffer); virtual WebKit::WebString readHTML(WebKit::WebClipboard::Buffer, @@ -38,8 +40,6 @@ class MockWebClipboardImpl : public WebKit::WebClipboard { const WebKit::WebImage&, const WebKit::WebURL&, const WebKit::WebString& title); - virtual WebKit::WebVector<WebKit::WebString> readAvailableTypes( - WebKit::WebClipboard::Buffer, bool* containsFilenames); private: WebKit::WebString m_plainText; diff --git a/webkit/tools/test_shell/simple_clipboard_impl.cc b/webkit/tools/test_shell/simple_clipboard_impl.cc index b521a65..d55460a 100644 --- a/webkit/tools/test_shell/simple_clipboard_impl.cc +++ b/webkit/tools/test_shell/simple_clipboard_impl.cc @@ -35,16 +35,20 @@ ui::Clipboard* ClipboardGetClipboard() { return clipboard.Pointer(); } +uint64 ClipboardGetSequenceNumber() { + return ClipboardGetClipboard()->GetSequenceNumber(); +} + bool ClipboardIsFormatAvailable(const ui::Clipboard::FormatType& format, ui::Clipboard::Buffer buffer) { return ClipboardGetClipboard()->IsFormatAvailable(format, buffer); } -// TODO(dcheng): Implement. void ClipboardReadAvailableTypes(ui::Clipboard::Buffer buffer, std::vector<string16>* types, bool* contains_filenames) { - return; + return ClipboardGetClipboard()->ReadAvailableTypes(buffer, types, + contains_filenames); } void ClipboardReadText(ui::Clipboard::Buffer buffer, string16* result) { @@ -86,18 +90,4 @@ void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data) { } } -bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type, - string16* data, string16* metadata) { - return false; -} - -bool ClipboardReadFilenames(ui::Clipboard::Buffer buffer, - std::vector<string16>* filenames) { - return false; -} - -uint64 ClipboardGetSequenceNumber() { - return 0; -} - } // namespace webkit_glue |