OLD | NEW |
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 #include "ui/base/clipboard/clipboard_util_win.h" | 5 #include "ui/base/clipboard/clipboard_util_win.h" |
6 | 6 |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 #include <shlwapi.h> | 8 #include <shlwapi.h> |
9 #include <wininet.h> // For INTERNET_MAX_URL_LENGTH. | 9 #include <wininet.h> // For INTERNET_MAX_URL_LENGTH. |
10 | 10 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, 0, TYMED_HGLOBAL}; | 196 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, 0, TYMED_HGLOBAL}; |
197 return &format; | 197 return &format; |
198 } | 198 } |
199 | 199 |
200 FORMATETC* ClipboardUtil::GetWebKitSmartPasteFormat() { | 200 FORMATETC* ClipboardUtil::GetWebKitSmartPasteFormat() { |
201 static UINT cf = RegisterClipboardFormat(L"WebKit Smart Paste Format"); | 201 static UINT cf = RegisterClipboardFormat(L"WebKit Smart Paste Format"); |
202 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; | 202 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; |
203 return &format; | 203 return &format; |
204 } | 204 } |
205 | 205 |
| 206 FORMATETC* ClipboardUtil::GetWebCustomDataFormat() { |
| 207 // TODO(dcheng): This name is temporary. See crbug.com/106449 |
| 208 static UINT cf = |
| 209 RegisterClipboardFormat(L"Chromium Web Custom MIME Data Format"); |
| 210 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; |
| 211 return &format; |
| 212 } |
| 213 |
206 | 214 |
207 bool ClipboardUtil::HasUrl(IDataObject* data_object) { | 215 bool ClipboardUtil::HasUrl(IDataObject* data_object) { |
208 DCHECK(data_object); | 216 DCHECK(data_object); |
209 return SUCCEEDED(data_object->QueryGetData(GetMozUrlFormat())) || | 217 return SUCCEEDED(data_object->QueryGetData(GetMozUrlFormat())) || |
210 SUCCEEDED(data_object->QueryGetData(GetUrlWFormat())) || | 218 SUCCEEDED(data_object->QueryGetData(GetUrlWFormat())) || |
211 SUCCEEDED(data_object->QueryGetData(GetUrlFormat())) || | 219 SUCCEEDED(data_object->QueryGetData(GetUrlFormat())) || |
212 SUCCEEDED(data_object->QueryGetData(GetFilenameWFormat())) || | 220 SUCCEEDED(data_object->QueryGetData(GetFilenameWFormat())) || |
213 SUCCEEDED(data_object->QueryGetData(GetFilenameFormat())); | 221 SUCCEEDED(data_object->QueryGetData(GetFilenameFormat())); |
214 } | 222 } |
215 | 223 |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 end_fragment_start + end_fragment_str.length())); | 559 end_fragment_start + end_fragment_str.length())); |
552 } | 560 } |
553 } else { | 561 } else { |
554 *fragment_start = cf_html.find('>', tag_start) + 1; | 562 *fragment_start = cf_html.find('>', tag_start) + 1; |
555 size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos); | 563 size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos); |
556 *fragment_end = cf_html.rfind('<', tag_end); | 564 *fragment_end = cf_html.rfind('<', tag_end); |
557 } | 565 } |
558 } | 566 } |
559 | 567 |
560 } // namespace ui | 568 } // namespace ui |
OLD | NEW |