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

Side by Side Diff: app/clipboard/clipboard_util_win.cc

Issue 351029: Support dragging a virtual file out of the browser. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 months 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 | « no previous file | app/os_exchange_data.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "app/clipboard/clipboard_util_win.h" 5 #include "app/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> 9 #include <wininet.h>
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 137
138 FORMATETC* ClipboardUtil::GetFileContentFormatZero() { 138 FORMATETC* ClipboardUtil::GetFileContentFormatZero() {
139 static UINT cf = RegisterClipboardFormat(CFSTR_FILECONTENTS); 139 static UINT cf = RegisterClipboardFormat(CFSTR_FILECONTENTS);
140 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, 0, TYMED_HGLOBAL}; 140 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, 0, TYMED_HGLOBAL};
141 return &format; 141 return &format;
142 } 142 }
143 143
144 FORMATETC* ClipboardUtil::GetWebKitSmartPasteFormat() { 144 FORMATETC* ClipboardUtil::GetWebKitSmartPasteFormat() {
145 static UINT cf = RegisterClipboardFormat(L"WebKit Smart Paste Format"); 145 static UINT cf = RegisterClipboardFormat(L"WebKit Smart Paste Format");
146 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, 0, TYMED_HGLOBAL}; 146 static FORMATETC format = {cf, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
147 return &format; 147 return &format;
148 } 148 }
149 149
150 150
151 bool ClipboardUtil::HasUrl(IDataObject* data_object) { 151 bool ClipboardUtil::HasUrl(IDataObject* data_object) {
152 DCHECK(data_object); 152 DCHECK(data_object);
153 return SUCCEEDED(data_object->QueryGetData(GetMozUrlFormat())) || 153 return SUCCEEDED(data_object->QueryGetData(GetMozUrlFormat())) ||
154 SUCCEEDED(data_object->QueryGetData(GetUrlWFormat())) || 154 SUCCEEDED(data_object->QueryGetData(GetUrlWFormat())) ||
155 SUCCEEDED(data_object->QueryGetData(GetUrlFormat())) || 155 SUCCEEDED(data_object->QueryGetData(GetUrlFormat())) ||
156 SUCCEEDED(data_object->QueryGetData(GetFilenameWFormat())) || 156 SUCCEEDED(data_object->QueryGetData(GetFilenameWFormat())) ||
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 size_t fragment_start = cf_html.find('>', tag_start) + 1; 479 size_t fragment_start = cf_html.find('>', tag_start) + 1;
480 size_t tag_end = cf_html.rfind("EndFragment", std::string::npos); 480 size_t tag_end = cf_html.rfind("EndFragment", std::string::npos);
481 size_t fragment_end = cf_html.rfind('<', tag_end); 481 size_t fragment_end = cf_html.rfind('<', tag_end);
482 if (fragment_start != std::string::npos && 482 if (fragment_start != std::string::npos &&
483 fragment_end != std::string::npos) { 483 fragment_end != std::string::npos) {
484 *html = cf_html.substr(fragment_start, fragment_end - fragment_start); 484 *html = cf_html.substr(fragment_start, fragment_end - fragment_start);
485 TrimWhitespace(*html, TRIM_ALL, html); 485 TrimWhitespace(*html, TRIM_ALL, html);
486 } 486 }
487 } 487 }
488 } 488 }
OLDNEW
« no previous file with comments | « no previous file | app/os_exchange_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698