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

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

Issue 8634002: Revert 111080 - Remove Task inheritance in clipboard code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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_mac.mm ('k') | no next file » | 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 // Many of these functions are based on those found in 5 // Many of these functions are based on those found in
6 // webkit/port/platform/PasteboardWin.cpp 6 // webkit/port/platform/PasteboardWin.cpp
7 7
8 #include "ui/base/clipboard/clipboard.h" 8 #include "ui/base/clipboard/clipboard.h"
9 9
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 clipboard_owner_ = NULL; 173 clipboard_owner_ = NULL;
174 } 174 }
175 175
176 Clipboard::~Clipboard() { 176 Clipboard::~Clipboard() {
177 if (clipboard_owner_) 177 if (clipboard_owner_)
178 ::DestroyWindow(clipboard_owner_); 178 ::DestroyWindow(clipboard_owner_);
179 clipboard_owner_ = NULL; 179 clipboard_owner_ = NULL;
180 } 180 }
181 181
182 void Clipboard::WriteObjects(const ObjectMap& objects) { 182 void Clipboard::WriteObjects(const ObjectMap& objects) {
183 WriteObjects(objects, NULL);
184 }
185
186 void Clipboard::WriteObjects(const ObjectMap& objects,
187 base::ProcessHandle process) {
183 ScopedClipboard clipboard; 188 ScopedClipboard clipboard;
184 if (!clipboard.Acquire(GetClipboardWindow())) 189 if (!clipboard.Acquire(GetClipboardWindow()))
185 return; 190 return;
186 191
187 ::EmptyClipboard(); 192 ::EmptyClipboard();
188 193
189 for (ObjectMap::const_iterator iter = objects.begin(); 194 for (ObjectMap::const_iterator iter = objects.begin();
190 iter != objects.end(); ++iter) { 195 iter != objects.end(); ++iter) {
191 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); 196 DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
192 } 197 }
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", 742 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass",
738 L"ClipboardOwnerWindow", 743 L"ClipboardOwnerWindow",
739 0, 0, 0, 0, 0, 744 0, 0, 0, 0, 0,
740 HWND_MESSAGE, 745 HWND_MESSAGE,
741 0, 0, 0); 746 0, 0, 0);
742 } 747 }
743 return clipboard_owner_; 748 return clipboard_owner_;
744 } 749 }
745 750
746 } // namespace ui 751 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698