OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_aurax11.h" | 5 #include "ui/base/clipboard/clipboard_aurax11.h" |
6 | 6 |
7 #include <X11/extensions/Xfixes.h> | 7 #include <X11/extensions/Xfixes.h> |
8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> |
9 #include <list> | 9 #include <list> |
10 #include <set> | 10 #include <set> |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 ClipboardAuraX11::ClipboardAuraX11() : aurax11_details_(new AuraX11Details) { | 663 ClipboardAuraX11::ClipboardAuraX11() : aurax11_details_(new AuraX11Details) { |
664 DCHECK(CalledOnValidThread()); | 664 DCHECK(CalledOnValidThread()); |
665 } | 665 } |
666 | 666 |
667 ClipboardAuraX11::~ClipboardAuraX11() { | 667 ClipboardAuraX11::~ClipboardAuraX11() { |
668 DCHECK(CalledOnValidThread()); | 668 DCHECK(CalledOnValidThread()); |
669 | 669 |
670 aurax11_details_->StoreCopyPasteDataAndWait(); | 670 aurax11_details_->StoreCopyPasteDataAndWait(); |
671 } | 671 } |
672 | 672 |
673 uint64 ClipboardAuraX11::GetSequenceNumber(ClipboardType type) { | 673 uint64 ClipboardAuraX11::GetSequenceNumber(ClipboardType type) const { |
674 DCHECK(CalledOnValidThread()); | 674 DCHECK(CalledOnValidThread()); |
675 if (type == CLIPBOARD_TYPE_COPY_PASTE) | 675 if (type == CLIPBOARD_TYPE_COPY_PASTE) |
676 return SelectionChangeObserver::GetInstance()->clipboard_sequence_number(); | 676 return SelectionChangeObserver::GetInstance()->clipboard_sequence_number(); |
677 else | 677 else |
678 return SelectionChangeObserver::GetInstance()->primary_sequence_number(); | 678 return SelectionChangeObserver::GetInstance()->primary_sequence_number(); |
679 } | 679 } |
680 | 680 |
681 bool ClipboardAuraX11::IsFormatAvailable(const FormatType& format, | 681 bool ClipboardAuraX11::IsFormatAvailable(const FormatType& format, |
682 ClipboardType type) const { | 682 ClipboardType type) const { |
683 DCHECK(CalledOnValidThread()); | 683 DCHECK(CalledOnValidThread()); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 if (format.Equals(GetBitmapFormatType())) | 929 if (format.Equals(GetBitmapFormatType())) |
930 return; | 930 return; |
931 | 931 |
932 std::vector<unsigned char> bytes(data_data, data_data + data_len); | 932 std::vector<unsigned char> bytes(data_data, data_data + data_len); |
933 scoped_refptr<base::RefCountedMemory> mem( | 933 scoped_refptr<base::RefCountedMemory> mem( |
934 base::RefCountedBytes::TakeVector(&bytes)); | 934 base::RefCountedBytes::TakeVector(&bytes)); |
935 aurax11_details_->InsertMapping(format.ToString(), mem); | 935 aurax11_details_->InsertMapping(format.ToString(), mem); |
936 } | 936 } |
937 | 937 |
938 } // namespace ui | 938 } // namespace ui |
OLD | NEW |