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

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

Issue 8606002: Remove Task inheritance in clipboard code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback from jam 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_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) {
188 ScopedClipboard clipboard; 183 ScopedClipboard clipboard;
189 if (!clipboard.Acquire(GetClipboardWindow())) 184 if (!clipboard.Acquire(GetClipboardWindow()))
190 return; 185 return;
191 186
192 ::EmptyClipboard(); 187 ::EmptyClipboard();
193 188
194 for (ObjectMap::const_iterator iter = objects.begin(); 189 for (ObjectMap::const_iterator iter = objects.begin();
195 iter != objects.end(); ++iter) { 190 iter != objects.end(); ++iter) {
196 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); 191 DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
197 } 192 }
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", 737 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass",
743 L"ClipboardOwnerWindow", 738 L"ClipboardOwnerWindow",
744 0, 0, 0, 0, 0, 739 0, 0, 0, 0, 0,
745 HWND_MESSAGE, 740 HWND_MESSAGE,
746 0, 0, 0); 741 0, 0, 0);
747 } 742 }
748 return clipboard_owner_; 743 return clipboard_owner_;
749 } 744 }
750 745
751 } // namespace ui 746 } // 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