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

Side by Side Diff: remoting/host/clipboard_win.cc

Issue 380553002: Add a unit test that filenames aren't unintentionally converted to URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 5 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 | « printing/backend/print_backend_win.cc ('k') | ui/base/clipboard/clipboard_util_win.h » ('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 #include "remoting/host/clipboard.h" 5 #include "remoting/host/clipboard.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 return; 235 return;
236 } 236 }
237 237
238 HGLOBAL text_global = clipboard.GetData(CF_UNICODETEXT); 238 HGLOBAL text_global = clipboard.GetData(CF_UNICODETEXT);
239 if (!text_global) { 239 if (!text_global) {
240 LOG(WARNING) << "Couldn't get data from the clipboard: " 240 LOG(WARNING) << "Couldn't get data from the clipboard: "
241 << GetLastError(); 241 << GetLastError();
242 return; 242 return;
243 } 243 }
244 244
245 base::win::ScopedHGlobal<WCHAR> text_lock(text_global); 245 base::win::ScopedHGlobal<WCHAR*> text_lock(text_global);
246 if (!text_lock.get()) { 246 if (!text_lock.get()) {
247 LOG(WARNING) << "Couldn't lock clipboard data: " << GetLastError(); 247 LOG(WARNING) << "Couldn't lock clipboard data: " << GetLastError();
248 return; 248 return;
249 } 249 }
250 text.assign(text_lock.get()); 250 text.assign(text_lock.get());
251 } 251 }
252 252
253 protocol::ClipboardEvent event; 253 protocol::ClipboardEvent event;
254 event.set_mime_type(kMimeTypeTextUtf8); 254 event.set_mime_type(kMimeTypeTextUtf8);
255 event.set_data(ReplaceCrLfByLf(base::UTF16ToUTF8(text))); 255 event.set_data(ReplaceCrLfByLf(base::UTF16ToUTF8(text)));
(...skipping 13 matching lines...) Expand all
269 } 269 }
270 270
271 return false; 271 return false;
272 } 272 }
273 273
274 scoped_ptr<Clipboard> Clipboard::Create() { 274 scoped_ptr<Clipboard> Clipboard::Create() {
275 return scoped_ptr<Clipboard>(new ClipboardWin()); 275 return scoped_ptr<Clipboard>(new ClipboardWin());
276 } 276 }
277 277
278 } // namespace remoting 278 } // namespace remoting
OLDNEW
« no previous file with comments | « printing/backend/print_backend_win.cc ('k') | ui/base/clipboard/clipboard_util_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698