| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 248 |
| 249 // Return the window that should be the clipboard owner, creating it | 249 // Return the window that should be the clipboard owner, creating it |
| 250 // if neccessary. Marked const for lazily initialization by const methods. | 250 // if neccessary. Marked const for lazily initialization by const methods. |
| 251 HWND GetClipboardWindow() const; | 251 HWND GetClipboardWindow() const; |
| 252 | 252 |
| 253 // Mark this as mutable so const methods can still do lazy initialization. | 253 // Mark this as mutable so const methods can still do lazy initialization. |
| 254 mutable HWND clipboard_owner_; | 254 mutable HWND clipboard_owner_; |
| 255 | 255 |
| 256 // True if we can create a window. | 256 // True if we can create a window. |
| 257 bool create_window_; | 257 bool create_window_; |
| 258 #elif !defined(OS_MACOSX) | 258 #elif defined(TOOLKIT_USES_GTK) |
| 259 // The public API is via WriteObjects() which dispatches to multiple | 259 // The public API is via WriteObjects() which dispatches to multiple |
| 260 // Write*() calls, but on GTK we must write all the clipboard types | 260 // Write*() calls, but on GTK we must write all the clipboard types |
| 261 // in a single GTK call. To support this we store the current set | 261 // in a single GTK call. To support this we store the current set |
| 262 // of data we intend to put on the clipboard on clipboard_data_ as | 262 // of data we intend to put on the clipboard on clipboard_data_ as |
| 263 // WriteObjects is running, and then at the end call SetGtkClipboard | 263 // WriteObjects is running, and then at the end call SetGtkClipboard |
| 264 // which replaces whatever is on the system clipboard with the | 264 // which replaces whatever is on the system clipboard with the |
| 265 // contents of clipboard_data_. | 265 // contents of clipboard_data_. |
| 266 | 266 |
| 267 public: | 267 public: |
| 268 typedef std::map<FormatType, std::pair<char*, size_t> > TargetMap; | 268 typedef std::map<FormatType, std::pair<char*, size_t> > TargetMap; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 285 static const char kMimeTypeText[]; | 285 static const char kMimeTypeText[]; |
| 286 static const char kMimeTypeHTML[]; | 286 static const char kMimeTypeHTML[]; |
| 287 static const char kMimeTypePNG[]; | 287 static const char kMimeTypePNG[]; |
| 288 | 288 |
| 289 DISALLOW_COPY_AND_ASSIGN(Clipboard); | 289 DISALLOW_COPY_AND_ASSIGN(Clipboard); |
| 290 }; | 290 }; |
| 291 | 291 |
| 292 } // namespace ui | 292 } // namespace ui |
| 293 | 293 |
| 294 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ | 294 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_H_ |
| OLD | NEW |