| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 const std::vector<FileInfo>& filenames) { | 192 const std::vector<FileInfo>& filenames) { |
| 193 std::vector<std::string> paths; | 193 std::vector<std::string> paths; |
| 194 for (std::vector<FileInfo>::const_iterator it = filenames.begin(); | 194 for (std::vector<FileInfo>::const_iterator it = filenames.begin(); |
| 195 it != filenames.end(); | 195 it != filenames.end(); |
| 196 ++it) { | 196 ++it) { |
| 197 std::string url_spec = net::FilePathToFileURL(it->path).spec(); | 197 std::string url_spec = net::FilePathToFileURL(it->path).spec(); |
| 198 if (!url_spec.empty()) | 198 if (!url_spec.empty()) |
| 199 paths.push_back(url_spec); | 199 paths.push_back(url_spec); |
| 200 } | 200 } |
| 201 | 201 |
| 202 std::string joined_data = JoinString(paths, '\n'); | 202 std::string joined_data = base::JoinString(paths, "\n"); |
| 203 scoped_refptr<base::RefCountedMemory> mem( | 203 scoped_refptr<base::RefCountedMemory> mem( |
| 204 base::RefCountedString::TakeString(&joined_data)); | 204 base::RefCountedString::TakeString(&joined_data)); |
| 205 format_map_.Insert(atom_cache_.GetAtom(Clipboard::kMimeTypeURIList), mem); | 205 format_map_.Insert(atom_cache_.GetAtom(Clipboard::kMimeTypeURIList), mem); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void OSExchangeDataProviderAuraX11::SetPickledData( | 208 void OSExchangeDataProviderAuraX11::SetPickledData( |
| 209 const OSExchangeData::CustomFormat& format, | 209 const OSExchangeData::CustomFormat& format, |
| 210 const base::Pickle& pickle) { | 210 const base::Pickle& pickle) { |
| 211 const unsigned char* data = | 211 const unsigned char* data = |
| 212 reinterpret_cast<const unsigned char*>(pickle.data()); | 212 reinterpret_cast<const unsigned char*>(pickle.data()); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 | 546 |
| 547 /////////////////////////////////////////////////////////////////////////////// | 547 /////////////////////////////////////////////////////////////////////////////// |
| 548 // OSExchangeData, public: | 548 // OSExchangeData, public: |
| 549 | 549 |
| 550 // static | 550 // static |
| 551 OSExchangeData::Provider* OSExchangeData::CreateProvider() { | 551 OSExchangeData::Provider* OSExchangeData::CreateProvider() { |
| 552 return new OSExchangeDataProviderAuraX11(); | 552 return new OSExchangeDataProviderAuraX11(); |
| 553 } | 553 } |
| 554 | 554 |
| 555 } // namespace ui | 555 } // namespace ui |
| OLD | NEW |