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

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

Issue 720373003: Add FakeClipboard implementation for unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more fix... Created 6 years, 1 month 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698