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 static UINT cf = | |
208 RegisterClipboardFormat(L"Chromium Web Custom MIME Data Format"); | |
tony
2011/12/05 20:24:50
Same comment here.
dcheng
2011/12/05 20:51:04
Done.
| |
209 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; | |
210 return &format; | |
211 } | |
212 | |
206 | 213 |
207 bool ClipboardUtil::HasUrl(IDataObject* data_object) { | 214 bool ClipboardUtil::HasUrl(IDataObject* data_object) { |
208 DCHECK(data_object); | 215 DCHECK(data_object); |
209 return SUCCEEDED(data_object->QueryGetData(GetMozUrlFormat())) || | 216 return SUCCEEDED(data_object->QueryGetData(GetMozUrlFormat())) || |
210 SUCCEEDED(data_object->QueryGetData(GetUrlWFormat())) || | 217 SUCCEEDED(data_object->QueryGetData(GetUrlWFormat())) || |
211 SUCCEEDED(data_object->QueryGetData(GetUrlFormat())) || | 218 SUCCEEDED(data_object->QueryGetData(GetUrlFormat())) || |
212 SUCCEEDED(data_object->QueryGetData(GetFilenameWFormat())) || | 219 SUCCEEDED(data_object->QueryGetData(GetFilenameWFormat())) || |
213 SUCCEEDED(data_object->QueryGetData(GetFilenameFormat())); | 220 SUCCEEDED(data_object->QueryGetData(GetFilenameFormat())); |
214 } | 221 } |
215 | 222 |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
551 end_fragment_start + end_fragment_str.length())); | 558 end_fragment_start + end_fragment_str.length())); |
552 } | 559 } |
553 } else { | 560 } else { |
554 *fragment_start = cf_html.find('>', tag_start) + 1; | 561 *fragment_start = cf_html.find('>', tag_start) + 1; |
555 size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos); | 562 size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos); |
556 *fragment_end = cf_html.rfind('<', tag_end); | 563 *fragment_end = cf_html.rfind('<', tag_end); |
557 } | 564 } |
558 } | 565 } |
559 | 566 |
560 } // namespace ui | 567 } // namespace ui |
OLD | NEW |