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_win.h" | 8 #include "ui/base/clipboard/clipboard_win.h" |
9 | 9 |
10 #include <shellapi.h> | 10 #include <shellapi.h> |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 | 381 |
382 // ClipboardWin implementation. | 382 // ClipboardWin implementation. |
383 ClipboardWin::ClipboardWin() { | 383 ClipboardWin::ClipboardWin() { |
384 if (base::MessageLoopForUI::IsCurrent()) | 384 if (base::MessageLoopForUI::IsCurrent()) |
385 clipboard_owner_.reset(new base::win::MessageWindow()); | 385 clipboard_owner_.reset(new base::win::MessageWindow()); |
386 } | 386 } |
387 | 387 |
388 ClipboardWin::~ClipboardWin() { | 388 ClipboardWin::~ClipboardWin() { |
389 } | 389 } |
390 | 390 |
391 uint64 ClipboardWin::GetSequenceNumber(ClipboardType type) { | 391 uint64 ClipboardWin::GetSequenceNumber(ClipboardType type) const { |
392 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); | 392 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); |
393 return ::GetClipboardSequenceNumber(); | 393 return ::GetClipboardSequenceNumber(); |
394 } | 394 } |
395 | 395 |
396 bool ClipboardWin::IsFormatAvailable(const Clipboard::FormatType& format, | 396 bool ClipboardWin::IsFormatAvailable(const Clipboard::FormatType& format, |
397 ClipboardType type) const { | 397 ClipboardType type) const { |
398 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); | 398 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); |
399 return ::IsClipboardFormatAvailable(format.ToFormatEtc().cfFormat) != FALSE; | 399 return ::IsClipboardFormatAvailable(format.ToFormatEtc().cfFormat) != FALSE; |
400 } | 400 } |
401 | 401 |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 if (!clipboard_owner_) | 853 if (!clipboard_owner_) |
854 return NULL; | 854 return NULL; |
855 | 855 |
856 if (clipboard_owner_->hwnd() == NULL) | 856 if (clipboard_owner_->hwnd() == NULL) |
857 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc)); | 857 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc)); |
858 | 858 |
859 return clipboard_owner_->hwnd(); | 859 return clipboard_owner_->hwnd(); |
860 } | 860 } |
861 | 861 |
862 } // namespace ui | 862 } // namespace ui |
OLD | NEW |