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

Unified Diff: content/public/common/url_utils.cc

Issue 15021020: content: Extract url utility functions into url_utils.{h,cc} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix content_unittests and content_browsertests Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/url_utils.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/url_utils.cc
diff --git a/content/public/common/url_utils.cc b/content/public/common/url_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e12a18bde2cff0d4e3e112f2af6176fbdef4d759
--- /dev/null
+++ b/content/public/common/url_utils.cc
@@ -0,0 +1,35 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/common/url_utils.h"
+
+#include "build/build_config.h"
+#include "content/common/savable_url_schemes.h"
+#include "content/public/common/url_constants.h"
+#include "googleurl/src/gurl.h"
+
+namespace content {
+
+const char* const* GetSavableSchemes() {
+ return GetSavableSchemesInternal();
+}
+
+bool HasWebUIScheme(const GURL& url) {
+ return
+#if !defined(OS_IOS)
+ url.SchemeIs(chrome::kChromeDevToolsScheme) ||
+ url.SchemeIs(chrome::kChromeInternalScheme) ||
+#endif
+ url.SchemeIs(chrome::kChromeUIScheme);
+}
+
+bool IsSavableURL(const GURL& url) {
+ for (int i = 0; GetSavableSchemes()[i] != NULL; ++i) {
+ if (url.SchemeIs(GetSavableSchemes()[i]))
+ return true;
+ }
+ return false;
+}
+
+} // namespace content
« no previous file with comments | « content/public/common/url_utils.h ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698