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

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

Issue 8801015: Revert 112986 - Implement Clipboard::ReadData and Clipboard::WriteData for Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_aurax11.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/clipboard/clipboard.h" 5 #include "ui/base/clipboard/clipboard.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/size.h" 9 #include "ui/gfx/size.h"
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 scoped_ptr<SharedMemory> bitmap_data( 134 scoped_ptr<SharedMemory> bitmap_data(
135 *reinterpret_cast<SharedMemory**>(raw_bitmap_data)); 135 *reinterpret_cast<SharedMemory**>(raw_bitmap_data));
136 136
137 if (!ValidateAndMapSharedBitmap(params, bitmap_data.get())) 137 if (!ValidateAndMapSharedBitmap(params, bitmap_data.get()))
138 return; 138 return;
139 WriteBitmap(static_cast<const char*>(bitmap_data->memory()), 139 WriteBitmap(static_cast<const char*>(bitmap_data->memory()),
140 &(params[1].front())); 140 &(params[1].front()));
141 break; 141 break;
142 } 142 }
143 143
144 #if !defined(OS_MACOSX)
144 case CBF_DATA: 145 case CBF_DATA:
145 WriteData(&(params[0].front()), params[0].size(), 146 WriteData(&(params[0].front()), params[0].size(),
146 &(params[1].front()), params[1].size()); 147 &(params[1].front()), params[1].size());
147 break; 148 break;
149 #endif // !defined(OS_MACOSX)
148 150
149 default: 151 default:
150 NOTREACHED(); 152 NOTREACHED();
151 } 153 }
152 } 154 }
153 155
154 // static 156 // static
155 void Clipboard::ReplaceSharedMemHandle(ObjectMap* objects, 157 void Clipboard::ReplaceSharedMemHandle(ObjectMap* objects,
156 base::SharedMemoryHandle bitmap_handle, 158 base::SharedMemoryHandle bitmap_handle,
157 base::ProcessHandle process) { 159 base::ProcessHandle process) {
(...skipping 18 matching lines...) Expand all
176 // UI thread (see DispatchObject()). 178 // UI thread (see DispatchObject()).
177 iter->second[0].clear(); 179 iter->second[0].clear();
178 for (size_t i = 0; i < sizeof(SharedMemory*); ++i) 180 for (size_t i = 0; i < sizeof(SharedMemory*); ++i)
179 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]); 181 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]);
180 has_shared_bitmap = true; 182 has_shared_bitmap = true;
181 } 183 }
182 } 184 }
183 } 185 }
184 186
185 } // namespace ui 187 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698