OLD | NEW |
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 // 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 <shellapi.h> | 10 #include <shellapi.h> |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 return FormatType(); | 197 return FormatType(); |
198 } | 198 } |
199 return FormatType(clipboard_format); | 199 return FormatType(clipboard_format); |
200 } | 200 } |
201 | 201 |
202 bool Clipboard::FormatType::operator<(const FormatType& other) const { | 202 bool Clipboard::FormatType::operator<(const FormatType& other) const { |
203 return ToUINT() < other.ToUINT(); | 203 return ToUINT() < other.ToUINT(); |
204 } | 204 } |
205 | 205 |
206 Clipboard::Clipboard() { | 206 Clipboard::Clipboard() { |
207 if (base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI) | 207 if (base::MessageLoopForUI::IsCurrent()) |
208 clipboard_owner_.reset(new base::win::MessageWindow()); | 208 clipboard_owner_.reset(new base::win::MessageWindow()); |
209 } | 209 } |
210 | 210 |
211 Clipboard::~Clipboard() { | 211 Clipboard::~Clipboard() { |
212 } | 212 } |
213 | 213 |
214 void Clipboard::WriteObjects(ClipboardType type, const ObjectMap& objects) { | 214 void Clipboard::WriteObjects(ClipboardType type, const ObjectMap& objects) { |
215 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); | 215 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); |
216 | 216 |
217 ScopedClipboard clipboard; | 217 ScopedClipboard clipboard; |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 if (!clipboard_owner_) | 827 if (!clipboard_owner_) |
828 return NULL; | 828 return NULL; |
829 | 829 |
830 if (clipboard_owner_->hwnd() == NULL) | 830 if (clipboard_owner_->hwnd() == NULL) |
831 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc)); | 831 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc)); |
832 | 832 |
833 return clipboard_owner_->hwnd(); | 833 return clipboard_owner_->hwnd(); |
834 } | 834 } |
835 | 835 |
836 } // namespace ui | 836 } // namespace ui |
OLD | NEW |