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

Side by Side Diff: ui/base/clipboard/clipboard_gtk.cc

Issue 8803006: Implement Clipboard::ReadData and Clipboard::WriteData for Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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) { 503 void Clipboard::ReadData(const std::string& format, std::string* result) const {
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698