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

Side by Side Diff: ui/base/dragdrop/os_exchange_data_provider_win.cc

Issue 7005011: Fix bug 79905: Drag and drop of "DownloadURL" type ignores specified filename for data URLs. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 | « net/base/net_util_unittest.cc ('k') | webkit/glue/weburlloader_impl.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/dragdrop/os_exchange_data_provider_win.h" 5 #include "ui/base/dragdrop/os_exchange_data_provider_win.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/i18n/file_util_icu.h" 8 #include "base/i18n/file_util_icu.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_handle.h" 10 #include "base/memory/scoped_handle.h"
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 static const std::string kInternetShortcutFileEnd = 841 static const std::string kInternetShortcutFileEnd =
842 "\r\n"; 842 "\r\n";
843 *data = kInternetShortcutFileStart + url.spec() + kInternetShortcutFileEnd; 843 *data = kInternetShortcutFileStart + url.spec() + kInternetShortcutFileEnd;
844 } 844 }
845 845
846 static void CreateValidFileNameFromTitle(const GURL& url, 846 static void CreateValidFileNameFromTitle(const GURL& url,
847 const string16& title, 847 const string16& title,
848 string16* validated) { 848 string16* validated) {
849 if (title.empty()) { 849 if (title.empty()) {
850 if (url.is_valid()) { 850 if (url.is_valid()) {
851 *validated = net::GetSuggestedFilename(url, "", "", string16()); 851 *validated = net::GetSuggestedFilename(url, "", "", "", string16());
852 } else { 852 } else {
853 // Nothing else can be done, just use a default. 853 // Nothing else can be done, just use a default.
854 *validated = 854 *validated =
855 l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); 855 l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME);
856 } 856 }
857 } else { 857 } else {
858 *validated = title; 858 *validated = title;
859 file_util::ReplaceIllegalCharactersInPath(validated, '-'); 859 file_util::ReplaceIllegalCharactersInPath(validated, '-');
860 } 860 }
861 static const wchar_t extension[] = L".url"; 861 static const wchar_t extension[] = L".url";
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 return new OSExchangeDataProviderWin(); 920 return new OSExchangeDataProviderWin();
921 } 921 }
922 922
923 // static 923 // static
924 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat( 924 OSExchangeData::CustomFormat OSExchangeData::RegisterCustomFormat(
925 const std::string& type) { 925 const std::string& type) {
926 return RegisterClipboardFormat(ASCIIToUTF16(type).c_str()); 926 return RegisterClipboardFormat(ASCIIToUTF16(type).c_str());
927 } 927 }
928 928
929 } // namespace ui 929 } // namespace ui
OLDNEW
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | webkit/glue/weburlloader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698