| 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 #include "ui/base/clipboard/clipboard.h" | 5 #include "ui/base/clipboard/clipboard.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 gtk_selection_data_free(data); | 285 gtk_selection_data_free(data); |
| 286 | 286 |
| 287 return retval; | 287 return retval; |
| 288 } | 288 } |
| 289 | 289 |
| 290 bool Clipboard::IsFormatAvailableByString(const std::string& format, | 290 bool Clipboard::IsFormatAvailableByString(const std::string& format, |
| 291 Clipboard::Buffer buffer) const { | 291 Clipboard::Buffer buffer) const { |
| 292 return IsFormatAvailable(format, buffer); | 292 return IsFormatAvailable(format, buffer); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void Clipboard::ReadAvailableTypes(Clipboard::Buffer buffer, |
| 296 std::vector<string16>* types, |
| 297 bool* contains_filenames) const { |
| 298 if (!types || !contains_filenames) { |
| 299 NOTREACHED(); |
| 300 return; |
| 301 } |
| 302 |
| 303 // TODO(dcheng): Implement me. |
| 304 types->clear(); |
| 305 *contains_filenames = false; |
| 306 } |
| 307 |
| 308 |
| 295 void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const { | 309 void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const { |
| 296 GtkClipboard* clipboard = LookupBackingClipboard(buffer); | 310 GtkClipboard* clipboard = LookupBackingClipboard(buffer); |
| 297 if (clipboard == NULL) | 311 if (clipboard == NULL) |
| 298 return; | 312 return; |
| 299 | 313 |
| 300 result->clear(); | 314 result->clear(); |
| 301 gchar* text = gtk_clipboard_wait_for_text(clipboard); | 315 gchar* text = gtk_clipboard_wait_for_text(clipboard); |
| 302 | 316 |
| 303 if (text == NULL) | 317 if (text == NULL) |
| 304 return; | 318 return; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 return clipboard_; | 435 return clipboard_; |
| 422 case BUFFER_SELECTION: | 436 case BUFFER_SELECTION: |
| 423 return primary_selection_; | 437 return primary_selection_; |
| 424 default: | 438 default: |
| 425 NOTREACHED(); | 439 NOTREACHED(); |
| 426 return NULL; | 440 return NULL; |
| 427 } | 441 } |
| 428 } | 442 } |
| 429 | 443 |
| 430 } // namespace ui | 444 } // namespace ui |
| OLD | NEW |