| 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 <X11/extensions/Xfixes.h> | 8 #include <X11/extensions/Xfixes.h> |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 string16* result) const { | 493 string16* result) const { |
| 494 // TODO(dcheng): Implement this. | 494 // TODO(dcheng): Implement this. |
| 495 NOTIMPLEMENTED(); | 495 NOTIMPLEMENTED(); |
| 496 } | 496 } |
| 497 | 497 |
| 498 void Clipboard::ReadBookmark(string16* title, std::string* url) const { | 498 void Clipboard::ReadBookmark(string16* title, std::string* url) const { |
| 499 // TODO(estade): implement this. | 499 // TODO(estade): implement this. |
| 500 NOTIMPLEMENTED(); | 500 NOTIMPLEMENTED(); |
| 501 } | 501 } |
| 502 | 502 |
| 503 void Clipboard::ReadData(const std::string& format, std::string* result) const { | 503 void Clipboard::ReadData(const std::string& format, std::string* result) { |
| 504 GtkSelectionData* data = | 504 GtkSelectionData* data = |
| 505 gtk_clipboard_wait_for_contents(clipboard_, StringToGdkAtom(format)); | 505 gtk_clipboard_wait_for_contents(clipboard_, StringToGdkAtom(format)); |
| 506 if (!data) | 506 if (!data) |
| 507 return; | 507 return; |
| 508 result->assign(reinterpret_cast<char*>(data->data), data->length); | 508 result->assign(reinterpret_cast<char*>(data->data), data->length); |
| 509 gtk_selection_data_free(data); | 509 gtk_selection_data_free(data); |
| 510 } | 510 } |
| 511 | 511 |
| 512 uint64 Clipboard::GetSequenceNumber(Buffer buffer) { | 512 uint64 Clipboard::GetSequenceNumber(Buffer buffer) { |
| 513 if (buffer == BUFFER_STANDARD) | 513 if (buffer == BUFFER_STANDARD) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 return clipboard_; | 554 return clipboard_; |
| 555 case BUFFER_SELECTION: | 555 case BUFFER_SELECTION: |
| 556 return primary_selection_; | 556 return primary_selection_; |
| 557 default: | 557 default: |
| 558 NOTREACHED(); | 558 NOTREACHED(); |
| 559 return NULL; | 559 return NULL; |
| 560 } | 560 } |
| 561 } | 561 } |
| 562 | 562 |
| 563 } // namespace ui | 563 } // namespace ui |
| OLD | NEW |