OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/clipboard/clipboard.h" | 8 #include "app/clipboard/clipboard.h" |
9 | 9 |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
11 #include <shellapi.h> | 11 #include <shellapi.h> |
12 | 12 |
13 #include "app/clipboard/clipboard_util_win.h" | 13 #include "app/clipboard/clipboard_util_win.h" |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/lock.h" | 15 #include "base/lock.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
18 #include "base/shared_memory.h" | 18 #include "base/shared_memory.h" |
19 #include "base/string_util.h" // Remove when ASCIIToWide is in utf_string_... | |
20 #include "base/string_number_conversions.h" | 19 #include "base/string_number_conversions.h" |
21 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
22 #include "gfx/size.h" | 21 #include "gfx/size.h" |
23 | 22 |
24 namespace { | 23 namespace { |
25 | 24 |
26 // A scoper to manage acquiring and automatically releasing the clipboard. | 25 // A scoper to manage acquiring and automatically releasing the clipboard. |
27 class ScopedClipboard { | 26 class ScopedClipboard { |
28 public: | 27 public: |
29 ScopedClipboard() : opened_(false) { } | 28 ScopedClipboard() : opened_(false) { } |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 HWND Clipboard::GetClipboardWindow() const { | 593 HWND Clipboard::GetClipboardWindow() const { |
595 if (!clipboard_owner_ && create_window_) { | 594 if (!clipboard_owner_ && create_window_) { |
596 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", | 595 clipboard_owner_ = ::CreateWindow(L"ClipboardOwnerWindowClass", |
597 L"ClipboardOwnerWindow", | 596 L"ClipboardOwnerWindow", |
598 0, 0, 0, 0, 0, | 597 0, 0, 0, 0, 0, |
599 HWND_MESSAGE, | 598 HWND_MESSAGE, |
600 0, 0, 0); | 599 0, 0, 0); |
601 } | 600 } |
602 return clipboard_owner_; | 601 return clipboard_owner_; |
603 } | 602 } |
OLD | NEW |