OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 5 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
6 #define UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 6 #define UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 Clipboard(); | 110 Clipboard(); |
111 ~Clipboard(); | 111 ~Clipboard(); |
112 | 112 |
113 // Write a bunch of objects to the system clipboard. Copies are made of the | 113 // Write a bunch of objects to the system clipboard. Copies are made of the |
114 // contents of |objects|. On Windows they are copied to the system clipboard. | 114 // contents of |objects|. On Windows they are copied to the system clipboard. |
115 // On linux they are copied into a structure owned by the Clipboard object and | 115 // On linux they are copied into a structure owned by the Clipboard object and |
116 // kept until the system clipboard is set again. | 116 // kept until the system clipboard is set again. |
117 void WriteObjects(const ObjectMap& objects); | 117 void WriteObjects(const ObjectMap& objects); |
118 | 118 |
119 // Behaves as above. If there is some shared memory handle passed as one of | |
120 // the objects, it came from the process designated by |process|. This will | |
121 // assist in turning it into a shared memory region that the current process | |
122 // can use. | |
123 void WriteObjects(const ObjectMap& objects, base::ProcessHandle process); | |
124 | |
125 // On Linux/BSD, we need to know when the clipboard is set to a URL. Most | 119 // On Linux/BSD, we need to know when the clipboard is set to a URL. Most |
126 // platforms don't care. | 120 // platforms don't care. |
127 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(USE_AURA) | 121 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(USE_AURA) |
128 void DidWriteURL(const std::string& utf8_text) {} | 122 void DidWriteURL(const std::string& utf8_text) {} |
129 #else // !defined(OS_WIN) && !defined(OS_MACOSX) | 123 #else // !defined(OS_WIN) && !defined(OS_MACOSX) |
130 void DidWriteURL(const std::string& utf8_text); | 124 void DidWriteURL(const std::string& utf8_text); |
131 #endif | 125 #endif |
132 | 126 |
133 // Returns a sequence number which uniquely identifies clipboard state. | 127 // Returns a sequence number which uniquely identifies clipboard state. |
134 // This can be used to version the data on the clipboard and determine | 128 // This can be used to version the data on the clipboard and determine |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 static const char kMimeTypeText[]; | 280 static const char kMimeTypeText[]; |
287 static const char kMimeTypeHTML[]; | 281 static const char kMimeTypeHTML[]; |
288 static const char kMimeTypePNG[]; | 282 static const char kMimeTypePNG[]; |
289 | 283 |
290 DISALLOW_COPY_AND_ASSIGN(Clipboard); | 284 DISALLOW_COPY_AND_ASSIGN(Clipboard); |
291 }; | 285 }; |
292 | 286 |
293 } // namespace ui | 287 } // namespace ui |
294 | 288 |
295 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 289 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
OLD | NEW |