OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 if (url.is_valid()) { | 910 if (url.is_valid()) { |
911 *validated = net::GetSuggestedFilename(url, "", "", "", "", | 911 *validated = net::GetSuggestedFilename(url, "", "", "", "", |
912 std::string()); | 912 std::string()); |
913 } else { | 913 } else { |
914 // Nothing else can be done, just use a default. | 914 // Nothing else can be done, just use a default. |
915 *validated = | 915 *validated = |
916 l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); | 916 l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); |
917 } | 917 } |
918 } else { | 918 } else { |
919 *validated = title; | 919 *validated = title; |
920 file_util::ReplaceIllegalCharactersInPath(validated, '-'); | 920 base::i18n::ReplaceIllegalCharactersInPath(validated, '-'); |
921 } | 921 } |
922 static const wchar_t extension[] = L".url"; | 922 static const wchar_t extension[] = L".url"; |
923 static const size_t max_length = MAX_PATH - arraysize(extension); | 923 static const size_t max_length = MAX_PATH - arraysize(extension); |
924 if (validated->size() > max_length) | 924 if (validated->size() > max_length) |
925 validated->erase(max_length); | 925 validated->erase(max_length); |
926 *validated += extension; | 926 *validated += extension; |
927 } | 927 } |
928 | 928 |
929 static STGMEDIUM* GetStorageForFileName(const base::FilePath& path) { | 929 static STGMEDIUM* GetStorageForFileName(const base::FilePath& path) { |
930 const size_t kDropSize = sizeof(DROPFILES); | 930 const size_t kDropSize = sizeof(DROPFILES); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 | 1048 |
1049 /////////////////////////////////////////////////////////////////////////////// | 1049 /////////////////////////////////////////////////////////////////////////////// |
1050 // OSExchangeData, public: | 1050 // OSExchangeData, public: |
1051 | 1051 |
1052 // static | 1052 // static |
1053 OSExchangeData::Provider* OSExchangeData::CreateProvider() { | 1053 OSExchangeData::Provider* OSExchangeData::CreateProvider() { |
1054 return new OSExchangeDataProviderWin(); | 1054 return new OSExchangeDataProviderWin(); |
1055 } | 1055 } |
1056 | 1056 |
1057 } // namespace ui | 1057 } // namespace ui |
OLD | NEW |