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

Unified Diff: ui/base/x/selection_utils.cc

Issue 129113004: linux_aura: Implement file drag and drop in content area. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/selection_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/selection_utils.cc
diff --git a/ui/base/x/selection_utils.cc b/ui/base/x/selection_utils.cc
index 5b501ec8721eb775cc638b6e240da179f258dc21..82b1051f60e521da65657addf944636a77758791 100644
--- a/ui/base/x/selection_utils.cc
+++ b/ui/base/x/selection_utils.cc
@@ -8,6 +8,7 @@
#include "base/i18n/icu_string_conversions.h"
#include "base/logging.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/x/x11_util.h"
@@ -43,6 +44,12 @@ std::vector< ::Atom> GetURLAtomsFrom(const X11AtomCache* atom_cache) {
return atoms;
}
+std::vector< ::Atom> GetURIListAtomsFrom(const X11AtomCache* atom_cache) {
+ std::vector< ::Atom> atoms;
+ atoms.push_back(atom_cache->GetAtom(Clipboard::kMimeTypeURIList));
+ return atoms;
+}
+
void GetAtomIntersection(const std::vector< ::Atom>& desired,
const std::vector< ::Atom>& offered,
std::vector< ::Atom>* output) {
@@ -62,6 +69,16 @@ void AddString16ToVector(const base::string16& str,
bytes->insert(bytes->end(), front, front + (str.size() * 2));
}
+std::vector<std::string> ParseURIList(const SelectionData& data) {
+ // uri-lists are newline separated file lists in URL encoding.
+ std::string unparsed;
+ data.AssignTo(&unparsed);
+
+ std::vector<std::string> tokens;
+ Tokenize(unparsed, "\n", &tokens);
+ return tokens;
+}
+
std::string RefCountedMemoryToString(
const scoped_refptr<base::RefCountedMemory>& memory) {
if (!memory.get()) {
« no previous file with comments | « ui/base/x/selection_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698