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 "webkit/fileapi/file_system_util.h" | 5 #include "webkit/fileapi/file_system_util.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 case kFileSystemTypeExternal: | 149 case kFileSystemTypeExternal: |
150 url += (kExternalDir + 1); // We don't want the leading slash. | 150 url += (kExternalDir + 1); // We don't want the leading slash. |
151 return GURL(url + "/"); | 151 return GURL(url + "/"); |
152 case kFileSystemTypeIsolated: | 152 case kFileSystemTypeIsolated: |
153 url += (kIsolatedDir + 1); // We don't want the leading slash. | 153 url += (kIsolatedDir + 1); // We don't want the leading slash. |
154 return GURL(url + "/"); | 154 return GURL(url + "/"); |
155 case kFileSystemTypeTest: | 155 case kFileSystemTypeTest: |
156 url += (kTestDir + 1); // We don't want the leading slash. | 156 url += (kTestDir + 1); // We don't want the leading slash. |
157 return GURL(url + "/"); | 157 return GURL(url + "/"); |
158 case kFileSystemTypeUnknown: | 158 case kFileSystemTypeUnknown: |
| 159 case kFileSystemTypeDragged: |
159 NOTREACHED(); | 160 NOTREACHED(); |
160 } | 161 } |
161 NOTREACHED(); | 162 NOTREACHED(); |
162 return GURL(); | 163 return GURL(); |
163 } | 164 } |
164 | 165 |
165 std::string GetFileSystemName(const GURL& origin_url, FileSystemType type) { | 166 std::string GetFileSystemName(const GURL& origin_url, FileSystemType type) { |
166 std::string origin_identifier = GetOriginIdentifierFromURL(origin_url); | 167 std::string origin_identifier = GetOriginIdentifierFromURL(origin_url); |
167 std::string type_string = GetFileSystemTypeString(type); | 168 std::string type_string = GetFileSystemTypeString(type); |
168 DCHECK(!type_string.empty()); | 169 DCHECK(!type_string.empty()); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 309 |
309 *filesystem_id = filesystem_name.substr(pos + start_token.length(), | 310 *filesystem_id = filesystem_name.substr(pos + start_token.length(), |
310 std::string::npos); | 311 std::string::npos); |
311 if (filesystem_id->empty()) | 312 if (filesystem_id->empty()) |
312 return false; | 313 return false; |
313 | 314 |
314 return true; | 315 return true; |
315 } | 316 } |
316 | 317 |
317 } // namespace fileapi | 318 } // namespace fileapi |
OLD | NEW |