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

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

Issue 22901023: linux_aura: Fix crash when dragging NTP icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exclude files on chromeos Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc ('k') | ui/ui_unittests.gypi » ('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 <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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 /////////////////////////////////////////////////////////////////////////////// 98 ///////////////////////////////////////////////////////////////////////////////
99 99
100 SelectionFormatMap::SelectionFormatMap() {} 100 SelectionFormatMap::SelectionFormatMap() {}
101 101
102 SelectionFormatMap::~SelectionFormatMap() {} 102 SelectionFormatMap::~SelectionFormatMap() {}
103 103
104 void SelectionFormatMap::Insert( 104 void SelectionFormatMap::Insert(
105 ::Atom atom, 105 ::Atom atom,
106 const scoped_refptr<base::RefCountedMemory>& item) { 106 const scoped_refptr<base::RefCountedMemory>& item) {
107 data_.erase(atom);
107 data_.insert(std::make_pair(atom, item)); 108 data_.insert(std::make_pair(atom, item));
108 } 109 }
109 110
110 ui::SelectionData SelectionFormatMap::GetFirstOf( 111 ui::SelectionData SelectionFormatMap::GetFirstOf(
111 const std::vector< ::Atom>& requested_types) const { 112 const std::vector< ::Atom>& requested_types) const {
112 for (std::vector< ::Atom>::const_iterator it = requested_types.begin(); 113 for (std::vector< ::Atom>::const_iterator it = requested_types.begin();
113 it != requested_types.end(); ++it) { 114 it != requested_types.end(); ++it) {
114 const_iterator data_it = data_.find(*it); 115 const_iterator data_it = data_.find(*it);
115 if (data_it != data_.end()) { 116 if (data_it != data_.end()) {
116 return SelectionData(data_it->first, data_it->second); 117 return SelectionData(data_it->first, data_it->second);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 224
224 void SelectionData::AssignTo(std::string* result) const { 225 void SelectionData::AssignTo(std::string* result) const {
225 *result = RefCountedMemoryToString(memory_); 226 *result = RefCountedMemoryToString(memory_);
226 } 227 }
227 228
228 void SelectionData::AssignTo(string16* result) const { 229 void SelectionData::AssignTo(string16* result) const {
229 *result = RefCountedMemoryToString16(memory_); 230 *result = RefCountedMemoryToString16(memory_);
230 } 231 }
231 232
232 } // namespace ui 233 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc ('k') | ui/ui_unittests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698