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

Side by Side Diff: ui/base/clipboard/scoped_clipboard_writer.cc

Issue 1154283003: Change most uses of Pickle to base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/clipboard/custom_data_helper_unittest.cc ('k') | ui/base/dragdrop/os_exchange_data.cc » ('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) 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 // This file implements the ScopedClipboardWriter class. Documentation on its 5 // This file implements the ScopedClipboardWriter class. Documentation on its
6 // purpose can be found in our header. Documentation on the format of the 6 // purpose can be found in our header. Documentation on the format of the
7 // parameters for each clipboard target can be found in clipboard.h. 7 // parameters for each clipboard target can be found in clipboard.h.
8 8
9 #include "ui/base/clipboard/scoped_clipboard_writer.h" 9 #include "ui/base/clipboard/scoped_clipboard_writer.h"
10 10
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 SkBitmap* bitmap_pointer = &bitmap_; 96 SkBitmap* bitmap_pointer = &bitmap_;
97 Clipboard::ObjectMapParam packed_pointer; 97 Clipboard::ObjectMapParam packed_pointer;
98 packed_pointer.resize(sizeof(bitmap_pointer)); 98 packed_pointer.resize(sizeof(bitmap_pointer));
99 *reinterpret_cast<SkBitmap**>(&*packed_pointer.begin()) = bitmap_pointer; 99 *reinterpret_cast<SkBitmap**>(&*packed_pointer.begin()) = bitmap_pointer;
100 Clipboard::ObjectMapParams parameters; 100 Clipboard::ObjectMapParams parameters;
101 parameters.push_back(packed_pointer); 101 parameters.push_back(packed_pointer);
102 objects_[Clipboard::CBF_SMBITMAP] = parameters; 102 objects_[Clipboard::CBF_SMBITMAP] = parameters;
103 } 103 }
104 104
105 void ScopedClipboardWriter::WritePickledData( 105 void ScopedClipboardWriter::WritePickledData(
106 const Pickle& pickle, const Clipboard::FormatType& format) { 106 const base::Pickle& pickle,
107 const Clipboard::FormatType& format) {
107 std::string format_string = format.Serialize(); 108 std::string format_string = format.Serialize();
108 Clipboard::ObjectMapParam format_parameter(format_string.begin(), 109 Clipboard::ObjectMapParam format_parameter(format_string.begin(),
109 format_string.end()); 110 format_string.end());
110 Clipboard::ObjectMapParam data_parameter; 111 Clipboard::ObjectMapParam data_parameter;
111 112
112 data_parameter.resize(pickle.size()); 113 data_parameter.resize(pickle.size());
113 memcpy(const_cast<char*>(&data_parameter.front()), 114 memcpy(const_cast<char*>(&data_parameter.front()),
114 pickle.data(), pickle.size()); 115 pickle.data(), pickle.size());
115 116
116 Clipboard::ObjectMapParams parameters; 117 Clipboard::ObjectMapParams parameters;
(...skipping 18 matching lines...) Expand all
135 objects_[Clipboard::CBF_TEXT] = parameters; 136 objects_[Clipboard::CBF_TEXT] = parameters;
136 137
137 if (is_url) { 138 if (is_url) {
138 url_text_ = utf8_text; 139 url_text_ = utf8_text;
139 } else { 140 } else {
140 url_text_.clear(); 141 url_text_.clear();
141 } 142 }
142 } 143 }
143 144
144 } // namespace ui 145 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/custom_data_helper_unittest.cc ('k') | ui/base/dragdrop/os_exchange_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698