Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: ui/base/clipboard/clipboard_util_win.cc

Issue 8805030: Revert 113040 - Enable custom MIME types in web copy/paste. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/clipboard/clipboard_util_win.h ('k') | ui/base/clipboard/clipboard_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
214 206
215 bool ClipboardUtil::HasUrl(IDataObject* data_object) { 207 bool ClipboardUtil::HasUrl(IDataObject* data_object) {
216 DCHECK(data_object); 208 DCHECK(data_object);
217 return SUCCEEDED(data_object->QueryGetData(GetMozUrlFormat())) || 209 return SUCCEEDED(data_object->QueryGetData(GetMozUrlFormat())) ||
218 SUCCEEDED(data_object->QueryGetData(GetUrlWFormat())) || 210 SUCCEEDED(data_object->QueryGetData(GetUrlWFormat())) ||
219 SUCCEEDED(data_object->QueryGetData(GetUrlFormat())) || 211 SUCCEEDED(data_object->QueryGetData(GetUrlFormat())) ||
220 SUCCEEDED(data_object->QueryGetData(GetFilenameWFormat())) || 212 SUCCEEDED(data_object->QueryGetData(GetFilenameWFormat())) ||
221 SUCCEEDED(data_object->QueryGetData(GetFilenameFormat())); 213 SUCCEEDED(data_object->QueryGetData(GetFilenameFormat()));
222 } 214 }
223 215
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 end_fragment_start + end_fragment_str.length())); 551 end_fragment_start + end_fragment_str.length()));
560 } 552 }
561 } else { 553 } else {
562 *fragment_start = cf_html.find('>', tag_start) + 1; 554 *fragment_start = cf_html.find('>', tag_start) + 1;
563 size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos); 555 size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos);
564 *fragment_end = cf_html.rfind('<', tag_end); 556 *fragment_end = cf_html.rfind('<', tag_end);
565 } 557 }
566 } 558 }
567 559
568 } // namespace ui 560 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_util_win.h ('k') | ui/base/clipboard/clipboard_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698