Chromium Code Reviews| 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 #include "content/public/common/url_utils.h" | 5 #include "content/public/common/url_utils.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/common/url_schemes.h" | 8 #include "content/common/url_schemes.h" |
| 9 #include "content/public/common/url_constants.h" | 9 #include "content/public/common/url_constants.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 bool HasWebUIScheme(const GURL& url) { | 13 bool HasWebUIScheme(const GURL& url) { |
| 14 return url.SchemeIs(kChromeDevToolsScheme) || | 14 return url.SchemeIs(kChromeDevToolsScheme) || |
| 15 url.SchemeIs(kChromeUIScheme); | 15 url.SchemeIs(kChromeUIScheme); |
| 16 } | 16 } |
| 17 | 17 |
| 18 bool IsSavableURL(const GURL& url) { | 18 bool IsSavableURL(const GURL& url) { |
| 19 for (auto& scheme : GetSavableSchemes()) { | 19 for (auto& scheme : GetSavableSchemes()) { |
| 20 if (url.SchemeIs(scheme)) | 20 if (url.SchemeIs(scheme)) |
| 21 return true; | 21 return true; |
| 22 } | 22 } |
| 23 return false; | 23 return false; |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool IsAboutBlankURL(const GURL& url) { | |
| 27 if (!url.SchemeIs(url::kAboutScheme)) | |
| 28 return false; | |
| 29 | |
| 30 if (url.has_host() || url.has_username() || url.has_password() || | |
| 31 url.has_port()) { | |
| 32 return false; | |
| 33 } | |
| 34 | |
| 35 if (url.path() != kAboutBlankPath && url.path() !=kAboutBlankWithHashPath) | |
|
Charlie Reis
2017/01/19 22:36:35
nit: Space after !=
clamy
2017/01/20 12:51:53
Done.
| |
| 36 return false; | |
| 37 | |
| 38 return true; | |
| 39 } | |
| 40 | |
| 26 } // namespace content | 41 } // namespace content |
| OLD | NEW |