| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef URL_GURL_H_ | 5 #ifndef URL_GURL_H_ |
| 6 #define URL_GURL_H_ | 6 #define URL_GURL_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // are often treated separately by some programs. | 214 // are often treated separately by some programs. |
| 215 bool SchemeIsFile() const { | 215 bool SchemeIsFile() const { |
| 216 return SchemeIs("file"); | 216 return SchemeIs("file"); |
| 217 } | 217 } |
| 218 | 218 |
| 219 // FileSystem URLs need to be treated differently in some cases. | 219 // FileSystem URLs need to be treated differently in some cases. |
| 220 bool SchemeIsFileSystem() const { | 220 bool SchemeIsFileSystem() const { |
| 221 return SchemeIs("filesystem"); | 221 return SchemeIs("filesystem"); |
| 222 } | 222 } |
| 223 | 223 |
| 224 #if defined(OS_ANDROID) |
| 225 // Content URLs need to be treated differently in some cases. |
| 226 bool SchemeIsContent() const { |
| 227 return SchemeIs("content"); |
| 228 } |
| 229 #endif |
| 230 |
| 224 // If the scheme indicates a secure connection | 231 // If the scheme indicates a secure connection |
| 225 bool SchemeIsSecure() const { | 232 bool SchemeIsSecure() const { |
| 226 return SchemeIs("https") || SchemeIs("wss") || | 233 return SchemeIs("https") || SchemeIs("wss") || |
| 227 (SchemeIsFileSystem() && inner_url() && inner_url()->SchemeIsSecure()); | 234 (SchemeIsFileSystem() && inner_url() && inner_url()->SchemeIsSecure()); |
| 228 } | 235 } |
| 229 | 236 |
| 230 // The "content" of the URL is everything after the scheme (skipping the | 237 // The "content" of the URL is everything after the scheme (skipping the |
| 231 // scheme delimiting colon). It is an error to get the origin of an invalid | 238 // scheme delimiting colon). It is an error to get the origin of an invalid |
| 232 // URL. The result will be an empty string. | 239 // URL. The result will be an empty string. |
| 233 std::string GetContent() const; | 240 std::string GetContent() const; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 // Used for nested schemes [currently only filesystem:]. | 385 // Used for nested schemes [currently only filesystem:]. |
| 379 scoped_ptr<GURL> inner_url_; | 386 scoped_ptr<GURL> inner_url_; |
| 380 | 387 |
| 381 // TODO bug 684583: Add encoding for query params. | 388 // TODO bug 684583: Add encoding for query params. |
| 382 }; | 389 }; |
| 383 | 390 |
| 384 // Stream operator so GURL can be used in assertion statements. | 391 // Stream operator so GURL can be used in assertion statements. |
| 385 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 392 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
| 386 | 393 |
| 387 #endif // URL_GURL_H_ | 394 #endif // URL_GURL_H_ |
| OLD | NEW |