| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace | 187 } // namespace |
| 188 | 188 |
| 189 // Clipboard::FormatType implementation. | 189 // Clipboard::FormatType implementation. |
| 190 Clipboard::FormatType::FormatType() : data_() {} | 190 Clipboard::FormatType::FormatType() : data_() {} |
| 191 | 191 |
| 192 Clipboard::FormatType::FormatType(UINT native_format) : data_() { | 192 Clipboard::FormatType::FormatType(UINT native_format) : data_() { |
| 193 // There's no good way to actually initialize this in the constructor in | 193 // There's no good way to actually initialize this in the constructor in |
| 194 // C++03. | 194 // C++03. |
| 195 data_.cfFormat = native_format; | 195 data_.cfFormat = static_cast<CLIPFORMAT>(native_format); |
| 196 data_.dwAspect = DVASPECT_CONTENT; | 196 data_.dwAspect = DVASPECT_CONTENT; |
| 197 data_.lindex = -1; | 197 data_.lindex = -1; |
| 198 data_.tymed = TYMED_HGLOBAL; | 198 data_.tymed = TYMED_HGLOBAL; |
| 199 } | 199 } |
| 200 | 200 |
| 201 Clipboard::FormatType::FormatType(UINT native_format, LONG index) : data_() { | 201 Clipboard::FormatType::FormatType(UINT native_format, LONG index) : data_() { |
| 202 // There's no good way to actually initialize this in the constructor in | 202 // There's no good way to actually initialize this in the constructor in |
| 203 // C++03. | 203 // C++03. |
| 204 data_.cfFormat = native_format; | 204 data_.cfFormat = static_cast<CLIPFORMAT>(native_format); |
| 205 data_.dwAspect = DVASPECT_CONTENT; | 205 data_.dwAspect = DVASPECT_CONTENT; |
| 206 data_.lindex = index; | 206 data_.lindex = index; |
| 207 data_.tymed = TYMED_HGLOBAL; | 207 data_.tymed = TYMED_HGLOBAL; |
| 208 } | 208 } |
| 209 | 209 |
| 210 Clipboard::FormatType::~FormatType() { | 210 Clipboard::FormatType::~FormatType() { |
| 211 } | 211 } |
| 212 | 212 |
| 213 std::string Clipboard::FormatType::Serialize() const { | 213 std::string Clipboard::FormatType::Serialize() const { |
| 214 return base::IntToString(data_.cfFormat); | 214 return base::IntToString(data_.cfFormat); |
| (...skipping 638 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 |