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.h" | 5 #include "ui/base/clipboard/clipboard.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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 if (XGetSelectionOwner(x_display_, selection_name) == x_window_) { | 392 if (XGetSelectionOwner(x_display_, selection_name) == x_window_) { |
393 // We can local fastpath instead of playing the nested message loop game | 393 // We can local fastpath instead of playing the nested message loop game |
394 // with the X server. | 394 // with the X server. |
395 SelectionFormatMap* format_map = LookupStorageForAtom(selection_name); | 395 SelectionFormatMap* format_map = LookupStorageForAtom(selection_name); |
396 DCHECK(format_map); | 396 DCHECK(format_map); |
397 | 397 |
398 for (std::vector< ::Atom>::const_iterator it = types.begin(); | 398 for (std::vector< ::Atom>::const_iterator it = types.begin(); |
399 it != types.end(); ++it) { | 399 it != types.end(); ++it) { |
400 SelectionFormatMap::const_iterator format_map_it = format_map->find(*it); | 400 SelectionFormatMap::const_iterator format_map_it = format_map->find(*it); |
401 if (format_map_it != format_map->end()) { | 401 if (format_map_it != format_map->end()) { |
402 scoped_ptr<SelectionData> data_out(new SelectionData(x_display_)); | 402 scoped_ptr<SelectionData> data_out(new SelectionData); |
403 data_out->Set(format_map_it->first, format_map_it->second.first, | 403 data_out->Set(format_map_it->first, format_map_it->second.first, |
404 format_map_it->second.second, false); | 404 format_map_it->second.second, false); |
405 return data_out.Pass(); | 405 return data_out.Pass(); |
406 } | 406 } |
407 } | 407 } |
408 } else { | 408 } else { |
409 TargetList targets = WaitAndGetTargetsList(buffer); | 409 TargetList targets = WaitAndGetTargetsList(buffer); |
410 SelectionRequestor* receiver = GetSelectionRequestorForBuffer(buffer); | 410 SelectionRequestor* receiver = GetSelectionRequestorForBuffer(buffer); |
411 | 411 |
412 std::vector< ::Atom> intersection; | 412 std::vector< ::Atom> intersection; |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 return type; | 848 return type; |
849 } | 849 } |
850 | 850 |
851 // static | 851 // static |
852 const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() { | 852 const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() { |
853 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypePepperCustomData)); | 853 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypePepperCustomData)); |
854 return type; | 854 return type; |
855 } | 855 } |
856 | 856 |
857 } // namespace ui | 857 } // namespace ui |
OLD | NEW |