OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/x/selection_utils.h" | 5 #include "ui/base/x/selection_utils.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/i18n/icu_string_conversions.h" | 9 #include "base/i18n/icu_string_conversions.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 for (const_iterator it = data_.begin(); it != data_.end(); ++it) | 126 for (const_iterator it = data_.begin(); it != data_.end(); ++it) |
127 atoms.push_back(it->first); | 127 atoms.push_back(it->first); |
128 | 128 |
129 return atoms; | 129 return atoms; |
130 } | 130 } |
131 | 131 |
132 /////////////////////////////////////////////////////////////////////////////// | 132 /////////////////////////////////////////////////////////////////////////////// |
133 | 133 |
134 SelectionData::SelectionData() | 134 SelectionData::SelectionData() |
135 : type_(None), | 135 : type_(None), |
136 atom_cache_(ui::GetXDisplay(), kSelectionDataAtoms) { | 136 atom_cache_(gfx::GetXDisplay(), kSelectionDataAtoms) { |
137 } | 137 } |
138 | 138 |
139 SelectionData::SelectionData( | 139 SelectionData::SelectionData( |
140 ::Atom type, | 140 ::Atom type, |
141 const scoped_refptr<base::RefCountedMemory>& memory) | 141 const scoped_refptr<base::RefCountedMemory>& memory) |
142 : type_(type), | 142 : type_(type), |
143 memory_(memory), | 143 memory_(memory), |
144 atom_cache_(ui::GetXDisplay(), kSelectionDataAtoms) { | 144 atom_cache_(gfx::GetXDisplay(), kSelectionDataAtoms) { |
145 } | 145 } |
146 | 146 |
147 SelectionData::SelectionData(const SelectionData& rhs) | 147 SelectionData::SelectionData(const SelectionData& rhs) |
148 : type_(rhs.type_), | 148 : type_(rhs.type_), |
149 memory_(rhs.memory_), | 149 memory_(rhs.memory_), |
150 atom_cache_(ui::GetXDisplay(), kSelectionDataAtoms) { | 150 atom_cache_(gfx::GetXDisplay(), kSelectionDataAtoms) { |
151 } | 151 } |
152 | 152 |
153 SelectionData::~SelectionData() {} | 153 SelectionData::~SelectionData() {} |
154 | 154 |
155 SelectionData& SelectionData::operator=(const SelectionData& rhs) { | 155 SelectionData& SelectionData::operator=(const SelectionData& rhs) { |
156 type_ = rhs.type_; | 156 type_ = rhs.type_; |
157 memory_ = rhs.memory_; | 157 memory_ = rhs.memory_; |
158 // TODO(erg): In some future where we have to support multiple X Displays, | 158 // TODO(erg): In some future where we have to support multiple X Displays, |
159 // the following will also need to deal with the display. | 159 // the following will also need to deal with the display. |
160 return *this; | 160 return *this; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 void SelectionData::AssignTo(std::string* result) const { | 225 void SelectionData::AssignTo(std::string* result) const { |
226 *result = RefCountedMemoryToString(memory_); | 226 *result = RefCountedMemoryToString(memory_); |
227 } | 227 } |
228 | 228 |
229 void SelectionData::AssignTo(string16* result) const { | 229 void SelectionData::AssignTo(string16* result) const { |
230 *result = RefCountedMemoryToString16(memory_); | 230 *result = RefCountedMemoryToString16(memory_); |
231 } | 231 } |
232 | 232 |
233 } // namespace ui | 233 } // namespace ui |
OLD | NEW |