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

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

Issue 8803006: 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)
145 case CBF_DATA: 144 case CBF_DATA:
146 WriteData(&(params[0].front()), params[0].size(), 145 WriteData(&(params[0].front()), params[0].size(),
147 &(params[1].front()), params[1].size()); 146 &(params[1].front()), params[1].size());
148 break; 147 break;
149 #endif // !defined(OS_MACOSX)
150 148
151 default: 149 default:
152 NOTREACHED(); 150 NOTREACHED();
153 } 151 }
154 } 152 }
155 153
156 // static 154 // static
157 void Clipboard::ReplaceSharedMemHandle(ObjectMap* objects, 155 void Clipboard::ReplaceSharedMemHandle(ObjectMap* objects,
158 base::SharedMemoryHandle bitmap_handle, 156 base::SharedMemoryHandle bitmap_handle,
159 base::ProcessHandle process) { 157 base::ProcessHandle process) {
(...skipping 18 matching lines...) Expand all
178 // UI thread (see DispatchObject()). 176 // UI thread (see DispatchObject()).
179 iter->second[0].clear(); 177 iter->second[0].clear();
180 for (size_t i = 0; i < sizeof(SharedMemory*); ++i) 178 for (size_t i = 0; i < sizeof(SharedMemory*); ++i)
181 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]); 179 iter->second[0].push_back(reinterpret_cast<char*>(&bitmap)[i]);
182 has_shared_bitmap = true; 180 has_shared_bitmap = true;
183 } 181 }
184 } 182 }
185 } 183 }
186 184
187 } // namespace ui 185 } // 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