summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-04 18:16:44 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-04 18:16:44 +0000
commit36780a15c5a9d7d7d1fa34f982a71d6072415e4a (patch)
tree167309420331862eb9b105d9a927e0ef0da90658 /content
parent0c52d8f310ef416feeb0ef79533b2d76ac19d972 (diff)
downloadchromium_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 'content')
-rw-r--r--content/browser/clipboard_dispatcher.cc33
-rw-r--r--content/browser/clipboard_dispatcher.h41
-rw-r--r--content/browser/renderer_host/clipboard_message_filter.cc37
-rw-r--r--content/browser/renderer_host/clipboard_message_filter.h6
-rw-r--r--content/common/clipboard_messages.h14
-rw-r--r--content/content_browser.gypi2
-rw-r--r--content/renderer/renderer_glue.cc30
7 files changed, 21 insertions, 142 deletions
diff --git a/content/browser/clipboard_dispatcher.cc b/content/browser/clipboard_dispatcher.cc
deleted file mode 100644
index c6fe39d..0000000
--- a/content/browser/clipboard_dispatcher.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2011 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 "content/browser/clipboard_dispatcher.h"
-
-#include "base/logging.h"
-
-bool ClipboardDispatcher::ReadAvailableTypes(ui::Clipboard::Buffer buffer,
- std::vector<string16>* types,
- bool* contains_filenames) {
- DCHECK(types);
- DCHECK(contains_filenames);
- types->clear();
- *contains_filenames = false;
- return false;
-}
-
-bool ClipboardDispatcher::ReadData(ui::Clipboard::Buffer buffer,
- const string16& type,
- string16* data,
- string16* metadata) {
- DCHECK(data);
- DCHECK(metadata);
- return false;
-}
-
-bool ClipboardDispatcher::ReadFilenames(ui::Clipboard::Buffer buffer,
- std::vector<string16>* filenames) {
- DCHECK(filenames);
- filenames->clear();
- return false;
-}
diff --git a/content/browser/clipboard_dispatcher.h b/content/browser/clipboard_dispatcher.h
deleted file mode 100644
index 7b62d0c..0000000
--- a/content/browser/clipboard_dispatcher.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 2010 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.
-
-#ifndef CONTENT_BROWSER_CLIPBOARD_DISPATCHER_H_
-#define CONTENT_BROWSER_CLIPBOARD_DISPATCHER_H_
-#pragma once
-
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/string16.h"
-#include "ui/base/clipboard/clipboard.h"
-
-// This class backs IPC requests from the renderer for clipboard data. In this
-// context, clipboard does not only refer to the usual concept of a clipboard
-// for copy/paste, which is why it's not in app/clipboard/clipboard.h. It can
-// refer to one of three different types of clipboards:
-// - The copy/paste clipboard, which contains data that has been copied/cut.
-// - The dragging clipboard, which contains data that is currently being
-// dragged.
-// - On X, the selection clipboard, which contains data for the current
-// selection.
-class ClipboardDispatcher {
- public:
- static bool ReadAvailableTypes(ui::Clipboard::Buffer buffer,
- std::vector<string16>* types,
- bool* contains_filenames);
- static bool ReadData(ui::Clipboard::Buffer buffer, const string16& type,
- string16* data, string16* metadata);
- static bool ReadFilenames(ui::Clipboard::Buffer buffer,
- std::vector<string16>* filenames);
-
- private:
- // This class is not meant to be instantiated. All public members are static.
- ClipboardDispatcher();
-
- DISALLOW_COPY_AND_ASSIGN(ClipboardDispatcher);
-};
-
-#endif // CONTENT_BROWSER_CLIPBOARD_DISPATCHER_H_
diff --git a/content/browser/renderer_host/clipboard_message_filter.cc b/content/browser/renderer_host/clipboard_message_filter.cc
index 2193841..ab6577f 100644
--- a/content/browser/renderer_host/clipboard_message_filter.cc
+++ b/content/browser/renderer_host/clipboard_message_filter.cc
@@ -11,7 +11,6 @@
#endif
#include "base/stl_util.h"
-#include "content/browser/clipboard_dispatcher.h"
#include "content/common/clipboard_messages.h"
#include "content/public/browser/content_browser_client.h"
#include "googleurl/src/gurl.h"
@@ -65,6 +64,7 @@ bool ClipboardMessageFilter::OnMessageReceived(const IPC::Message& message,
IPC_BEGIN_MESSAGE_MAP_EX(ClipboardMessageFilter, message, *message_was_ok)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsAsync, OnWriteObjectsAsync)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_WriteObjectsSync, OnWriteObjectsSync)
+ IPC_MESSAGE_HANDLER(ClipboardHostMsg_GetSequenceNumber, OnGetSequenceNumber)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_IsFormatAvailable, OnIsFormatAvailable)
IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadAvailableTypes,
OnReadAvailableTypes)
@@ -76,9 +76,6 @@ bool ClipboardMessageFilter::OnMessageReceived(const IPC::Message& message,
IPC_MESSAGE_HANDLER(ClipboardHostMsg_FindPboardWriteStringAsync,
OnFindPboardWriteString)
#endif
- IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadData, OnReadData)
- IPC_MESSAGE_HANDLER(ClipboardHostMsg_ReadFilenames, OnReadFilenames)
- IPC_MESSAGE_HANDLER(ClipboardHostMsg_GetSequenceNumber, OnGetSequenceNumber)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -127,6 +124,16 @@ void ClipboardMessageFilter::OnWriteObjectsAsync(
new WriteClipboardTask(long_living_objects));
}
+void ClipboardMessageFilter::OnGetSequenceNumber(uint64* seq_num) {
+ *seq_num = GetClipboard()->GetSequenceNumber();
+}
+
+void ClipboardMessageFilter::OnReadAvailableTypes(
+ ui::Clipboard::Buffer buffer, std::vector<string16>* types,
+ bool* contains_filenames) {
+ GetClipboard()->ReadAvailableTypes(buffer, types, contains_filenames);
+}
+
void ClipboardMessageFilter::OnIsFormatAvailable(
const ui::Clipboard::FormatType& format, ui::Clipboard::Buffer buffer,
bool* result) {
@@ -197,28 +204,6 @@ void ClipboardMessageFilter::OnReadImageReply(
Send(reply_msg);
}
-void ClipboardMessageFilter::OnReadAvailableTypes(
- ui::Clipboard::Buffer buffer, std::vector<string16>* types,
- bool* contains_filenames) {
- GetClipboard()->ReadAvailableTypes(buffer, types, contains_filenames);
-}
-
-void ClipboardMessageFilter::OnReadData(
- ui::Clipboard::Buffer buffer, const string16& type, bool* succeeded,
- string16* data, string16* metadata) {
- *succeeded = ClipboardDispatcher::ReadData(buffer, type, data, metadata);
-}
-
-void ClipboardMessageFilter::OnReadFilenames(
- ui::Clipboard::Buffer buffer, bool* succeeded,
- std::vector<string16>* filenames) {
- *succeeded = ClipboardDispatcher::ReadFilenames(buffer, filenames);
-}
-
-void ClipboardMessageFilter::OnGetSequenceNumber(uint64* seq_num) {
- *seq_num = GetClipboard()->GetSequenceNumber();
-}
-
// static
ui::Clipboard* ClipboardMessageFilter::GetClipboard() {
// We have a static instance of the clipboard service for use by all message
diff --git a/content/browser/renderer_host/clipboard_message_filter.h b/content/browser/renderer_host/clipboard_message_filter.h
index db165ae..d84a083 100644
--- a/content/browser/renderer_host/clipboard_message_filter.h
+++ b/content/browser/renderer_host/clipboard_message_filter.h
@@ -29,6 +29,7 @@ class ClipboardMessageFilter : public BrowserMessageFilter {
void OnWriteObjectsSync(const ui::Clipboard::ObjectMap& objects,
base::SharedMemoryHandle bitmap_handle);
+ void OnGetSequenceNumber(uint64* seq_num);
void OnIsFormatAvailable(const ui::Clipboard::FormatType& format,
ui::Clipboard::Buffer buffer,
bool* result);
@@ -44,11 +45,6 @@ class ClipboardMessageFilter : public BrowserMessageFilter {
#if defined(OS_MACOSX)
void OnFindPboardWriteString(const string16& text);
#endif
- void OnReadData(ui::Clipboard::Buffer buffer, const string16& type,
- bool* succeeded, string16* data, string16* metadata);
- void OnReadFilenames(ui::Clipboard::Buffer buffer, bool* succeeded,
- std::vector<string16>* filenames);
- void OnGetSequenceNumber(uint64* seq_num);
// We have our own clipboard because we want to access the clipboard on the
// IO thread instead of forwarding (possibly synchronous) messages to the UI
diff --git a/content/common/clipboard_messages.h b/content/common/clipboard_messages.h
index 72a15f3..3569df0 100644
--- a/content/common/clipboard_messages.h
+++ b/content/common/clipboard_messages.h
@@ -28,6 +28,8 @@ IPC_MESSAGE_CONTROL1(ClipboardHostMsg_WriteObjectsAsync,
IPC_SYNC_MESSAGE_CONTROL2_0(ClipboardHostMsg_WriteObjectsSync,
ui::Clipboard::ObjectMap /* objects */,
base::SharedMemoryHandle /* bitmap handle */)
+IPC_SYNC_MESSAGE_CONTROL0_1(ClipboardHostMsg_GetSequenceNumber,
+ uint64 /* result */)
IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_IsFormatAvailable,
std::string /* format */,
ui::Clipboard::Buffer /* buffer */,
@@ -52,20 +54,8 @@ IPC_SYNC_MESSAGE_CONTROL1_2(ClipboardHostMsg_ReadImage,
ui::Clipboard::Buffer /* buffer */,
base::SharedMemoryHandle /* PNG-encoded image */,
uint32 /* image size */)
-IPC_SYNC_MESSAGE_CONTROL0_1(ClipboardHostMsg_GetSequenceNumber,
- uint64 /* result */)
#if defined(OS_MACOSX)
IPC_MESSAGE_CONTROL1(ClipboardHostMsg_FindPboardWriteStringAsync,
string16 /* text */)
#endif
-IPC_SYNC_MESSAGE_CONTROL2_3(ClipboardHostMsg_ReadData,
- ui::Clipboard::Buffer /* buffer */,
- string16 /* type */,
- bool /* succeeded */,
- string16 /* data */,
- string16 /* metadata */)
-IPC_SYNC_MESSAGE_CONTROL1_2(ClipboardHostMsg_ReadFilenames,
- ui::Clipboard::Buffer /* buffer */,
- bool /* result */,
- std::vector<string16> /* filenames */)
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index 687c03e..58b5abf 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -75,8 +75,6 @@
'browser/child_process_security_policy.h',
'browser/chrome_blob_storage_context.cc',
'browser/chrome_blob_storage_context.h',
- 'browser/clipboard_dispatcher.h',
- 'browser/clipboard_dispatcher.cc',
'browser/cross_site_request_manager.cc',
'browser/cross_site_request_manager.h',
'browser/debugger/devtools_agent_host.cc',
diff --git a/content/renderer/renderer_glue.cc b/content/renderer/renderer_glue.cc
index 8f339f1..627061e 100644
--- a/content/renderer/renderer_glue.cc
+++ b/content/renderer/renderer_glue.cc
@@ -96,6 +96,13 @@ ui::Clipboard* ClipboardGetClipboard() {
return NULL;
}
+uint64 ClipboardGetSequenceNumber() {
+ uint64 seq_num = 0;
+ RenderThreadImpl::current()->Send(
+ new ClipboardHostMsg_GetSequenceNumber(&seq_num));
+ return seq_num;
+}
+
bool ClipboardIsFormatAvailable(const ui::Clipboard::FormatType& format,
ui::Clipboard::Buffer buffer) {
bool result;
@@ -141,29 +148,6 @@ void ClipboardReadImage(ui::Clipboard::Buffer buffer, std::string* data) {
}
}
-bool ClipboardReadData(ui::Clipboard::Buffer buffer, const string16& type,
- string16* data, string16* metadata) {
- bool result = false;
- RenderThreadImpl::current()->Send(new ClipboardHostMsg_ReadData(
- buffer, type, &result, data, metadata));
- return result;
-}
-
-bool ClipboardReadFilenames(ui::Clipboard::Buffer buffer,
- std::vector<string16>* filenames) {
- bool result;
- RenderThreadImpl::current()->Send(new ClipboardHostMsg_ReadFilenames(
- buffer, &result, filenames));
- return result;
-}
-
-uint64 ClipboardGetSequenceNumber() {
- uint64 seq_num = 0;
- RenderThreadImpl::current()->Send(
- new ClipboardHostMsg_GetSequenceNumber(&seq_num));
- return seq_num;
-}
-
void GetPlugins(bool refresh,
std::vector<webkit::WebPluginInfo>* plugins) {
if (!RenderThreadImpl::current()->plugin_refresh_allowed())