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

Unified Diff: base/clipboard.h

Issue 41012: This changes the base clipboard class. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months 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 | « no previous file | base/clipboard_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/clipboard.h
===================================================================
--- base/clipboard.h (revision 11372)
+++ base/clipboard.h (working copy)
@@ -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 @@
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 @@
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.
« no previous file with comments | « no previous file | base/clipboard_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698