summaryrefslogtreecommitdiffstats
path: root/base/clipboard.h
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 22:01:15 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 22:01:15 +0000
commitc033cbe94c504d2346c5e99c1ac12fda41f3f46a (patch)
tree85e1dae7db66e8cf0cc56edb64d15d4a59a70010 /base/clipboard.h
parent75d52ac5b9e0c0531b17095a5750918c281a7f0d (diff)
downloadchromium_src-c033cbe94c504d2346c5e99c1ac12fda41f3f46a.zip
chromium_src-c033cbe94c504d2346c5e99c1ac12fda41f3f46a.tar.gz
chromium_src-c033cbe94c504d2346c5e99c1ac12fda41f3f46a.tar.bz2
This changes the base clipboard class, as accomplishing paste requires that Clipboard::FormatType be IPC-able. The lowest-common denominator of unsigned int, NSString*, and GdkAtom is string, so string it is. (Linux changes by estade.)
Review URL: http://codereview.chromium.org/41012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11383 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/clipboard.h')
-rw-r--r--base/clipboard.h24
1 files changed, 6 insertions, 18 deletions
diff --git a/base/clipboard.h b/base/clipboard.h
index 5abf4774..546c498 100644
--- a/base/clipboard.h
+++ b/base/clipboard.h
@@ -14,24 +14,12 @@
#include "base/string16.h"
#include "base/gfx/size.h"
-#if defined(OS_MACOSX)
-#if defined(__OBJC__)
-@class NSString;
-#else
-class NSString;
-#endif
-#endif
-
class Clipboard {
public:
-#if defined(OS_WIN)
- typedef unsigned int FormatType;
-#elif defined(OS_MACOSX)
- typedef NSString *FormatType;
-#elif defined(OS_LINUX)
- typedef struct _GdkAtom* FormatType;
+ typedef std::string FormatType;
+#if defined(OS_LINUX)
typedef struct _GtkClipboard GtkClipboard;
- typedef std::map<std::string, std::pair<char*, size_t> > TargetMap;
+ typedef std::map<FormatType, std::pair<char*, size_t> > TargetMap;
#endif
// ObjectType designates the type of data to be stored in the clipboard. This
@@ -95,7 +83,7 @@ class Clipboard {
void WriteObjects(const ObjectMap& objects, base::ProcessHandle process);
// Tests whether the clipboard contains a certain format
- bool IsFormatAvailable(FormatType format) const;
+ bool IsFormatAvailable(const FormatType& format) const;
// Reads UNICODE text from the clipboard, if available.
void ReadText(string16* result) const;
@@ -173,14 +161,14 @@ class Clipboard {
const gfx::Size& size);
// Safely write to system clipboard. Free |handle| on failure.
- void WriteToClipboard(FormatType format, HANDLE handle);
+ void WriteToClipboard(unsigned int format, HANDLE handle);
static void ParseBookmarkClipboardFormat(const string16& bookmark,
string16* title,
std::string* url);
// Free a handle depending on its type (as intuited from format)
- static void FreeData(FormatType format, HANDLE data);
+ static void FreeData(unsigned int format, HANDLE data);
// Return the window that should be the clipboard owner, creating it
// if neccessary. Marked const for lazily initialization by const methods.