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

Side by Side Diff: ui/base/x/selection_utils.cc

Issue 2047703003: Revert of Implement ui::ClipboardMus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « ui/base/x/selection_utils.h ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
11 11
12 #include "base/i18n/icu_string_conversions.h" 12 #include "base/i18n/icu_string_conversions.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/strings/string_split.h" 14 #include "base/strings/string_split.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "ui/base/clipboard/clipboard.h" 17 #include "ui/base/clipboard/clipboard.h"
18 #include "ui/base/x/x11_util.h" 18 #include "ui/base/x/x11_util.h"
19 #include "ui/gfx/x/x11_atom_cache.h" 19 #include "ui/gfx/x/x11_atom_cache.h"
20 20
21 namespace ui { 21 namespace ui {
22 22
23 const char kMimeTypeMozillaURL[] = "text/x-moz-url";
23 const char kString[] = "STRING"; 24 const char kString[] = "STRING";
24 const char kText[] = "TEXT"; 25 const char kText[] = "TEXT";
25 const char kTextPlain[] = "text/plain"; 26 const char kTextPlain[] = "text/plain";
26 const char kTextPlainUtf8[] = "text/plain;charset=utf-8"; 27 const char kTextPlainUtf8[] = "text/plain;charset=utf-8";
27 const char kUtf8String[] = "UTF8_STRING"; 28 const char kUtf8String[] = "UTF8_STRING";
28 29
29 const char* kSelectionDataAtoms[] = { 30 const char* kSelectionDataAtoms[] = {
30 Clipboard::kMimeTypeHTML, 31 Clipboard::kMimeTypeHTML,
31 kString, 32 kString,
32 kText, 33 kText,
33 kTextPlain, 34 kTextPlain,
34 kTextPlainUtf8, 35 kTextPlainUtf8,
35 kUtf8String, 36 kUtf8String,
36 NULL 37 NULL
37 }; 38 };
38 39
39 std::vector< ::Atom> GetTextAtomsFrom(const X11AtomCache* atom_cache) { 40 std::vector< ::Atom> GetTextAtomsFrom(const X11AtomCache* atom_cache) {
40 std::vector< ::Atom> atoms; 41 std::vector< ::Atom> atoms;
41 atoms.push_back(atom_cache->GetAtom(kUtf8String)); 42 atoms.push_back(atom_cache->GetAtom(kUtf8String));
42 atoms.push_back(atom_cache->GetAtom(kString)); 43 atoms.push_back(atom_cache->GetAtom(kString));
43 atoms.push_back(atom_cache->GetAtom(kText)); 44 atoms.push_back(atom_cache->GetAtom(kText));
44 atoms.push_back(atom_cache->GetAtom(kTextPlain)); 45 atoms.push_back(atom_cache->GetAtom(kTextPlain));
45 atoms.push_back(atom_cache->GetAtom(kTextPlainUtf8)); 46 atoms.push_back(atom_cache->GetAtom(kTextPlainUtf8));
46 return atoms; 47 return atoms;
47 } 48 }
48 49
49 std::vector< ::Atom> GetURLAtomsFrom(const X11AtomCache* atom_cache) { 50 std::vector< ::Atom> GetURLAtomsFrom(const X11AtomCache* atom_cache) {
50 std::vector< ::Atom> atoms; 51 std::vector< ::Atom> atoms;
51 atoms.push_back(atom_cache->GetAtom(Clipboard::kMimeTypeURIList)); 52 atoms.push_back(atom_cache->GetAtom(Clipboard::kMimeTypeURIList));
52 atoms.push_back(atom_cache->GetAtom(Clipboard::kMimeTypeMozillaURL)); 53 atoms.push_back(atom_cache->GetAtom(kMimeTypeMozillaURL));
53 return atoms; 54 return atoms;
54 } 55 }
55 56
56 std::vector< ::Atom> GetURIListAtomsFrom(const X11AtomCache* atom_cache) { 57 std::vector< ::Atom> GetURIListAtomsFrom(const X11AtomCache* atom_cache) {
57 std::vector< ::Atom> atoms; 58 std::vector< ::Atom> atoms;
58 atoms.push_back(atom_cache->GetAtom(Clipboard::kMimeTypeURIList)); 59 atoms.push_back(atom_cache->GetAtom(Clipboard::kMimeTypeURIList));
59 return atoms; 60 return atoms;
60 } 61 }
61 62
62 void GetAtomIntersection(const std::vector< ::Atom>& desired, 63 void GetAtomIntersection(const std::vector< ::Atom>& desired,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 251
251 void SelectionData::AssignTo(std::string* result) const { 252 void SelectionData::AssignTo(std::string* result) const {
252 *result = RefCountedMemoryToString(memory_); 253 *result = RefCountedMemoryToString(memory_);
253 } 254 }
254 255
255 void SelectionData::AssignTo(base::string16* result) const { 256 void SelectionData::AssignTo(base::string16* result) const {
256 *result = RefCountedMemoryToString16(memory_); 257 *result = RefCountedMemoryToString16(memory_);
257 } 258 }
258 259
259 } // namespace ui 260 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/x/selection_utils.h ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698