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/dragdrop/os_exchange_data_provider_aurax11.h" | 5 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
9 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
10 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
11 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
12 #include "net/base/filename_util.h" | 14 #include "net/base/filename_util.h" |
13 #include "ui/base/clipboard/clipboard.h" | 15 #include "ui/base/clipboard/clipboard.h" |
14 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 16 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
15 #include "ui/base/dragdrop/file_info.h" | 17 #include "ui/base/dragdrop/file_info.h" |
16 #include "ui/base/x/selection_utils.h" | 18 #include "ui/base/x/selection_utils.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // We return the |selection_owner_|'s format map instead of our own in case | 107 // We return the |selection_owner_|'s format map instead of our own in case |
106 // ours has been modified since TakeOwnershipOfSelection() was called. | 108 // ours has been modified since TakeOwnershipOfSelection() was called. |
107 return selection_owner_.selection_format_map(); | 109 return selection_owner_.selection_format_map(); |
108 } | 110 } |
109 | 111 |
110 std::unique_ptr<OSExchangeData::Provider> | 112 std::unique_ptr<OSExchangeData::Provider> |
111 OSExchangeDataProviderAuraX11::Clone() const { | 113 OSExchangeDataProviderAuraX11::Clone() const { |
112 std::unique_ptr<OSExchangeDataProviderAuraX11> ret( | 114 std::unique_ptr<OSExchangeDataProviderAuraX11> ret( |
113 new OSExchangeDataProviderAuraX11()); | 115 new OSExchangeDataProviderAuraX11()); |
114 ret->format_map_ = format_map_; | 116 ret->format_map_ = format_map_; |
115 return ret; | 117 return std::move(ret); |
116 } | 118 } |
117 | 119 |
118 void OSExchangeDataProviderAuraX11::MarkOriginatedFromRenderer() { | 120 void OSExchangeDataProviderAuraX11::MarkOriginatedFromRenderer() { |
119 std::string empty; | 121 std::string empty; |
120 format_map_.Insert(atom_cache_.GetAtom(kRendererTaint), | 122 format_map_.Insert(atom_cache_.GetAtom(kRendererTaint), |
121 scoped_refptr<base::RefCountedMemory>( | 123 scoped_refptr<base::RefCountedMemory>( |
122 base::RefCountedString::TakeString(&empty))); | 124 base::RefCountedString::TakeString(&empty))); |
123 } | 125 } |
124 | 126 |
125 bool OSExchangeDataProviderAuraX11::DidOriginateFromRenderer() const { | 127 bool OSExchangeDataProviderAuraX11::DidOriginateFromRenderer() const { |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 } | 541 } |
540 | 542 |
541 return false; | 543 return false; |
542 } | 544 } |
543 | 545 |
544 std::vector< ::Atom> OSExchangeDataProviderAuraX11::GetTargets() const { | 546 std::vector< ::Atom> OSExchangeDataProviderAuraX11::GetTargets() const { |
545 return format_map_.GetTypes(); | 547 return format_map_.GetTypes(); |
546 } | 548 } |
547 | 549 |
548 } // namespace ui | 550 } // namespace ui |
OLD | NEW |