1 // Copyright (c) 2021 The Chromium Embedded Framework Authors. All rights 2 // reserved. Use of this source code is governed by a BSD-style license that 3 // can be found in the LICENSE file. 4 5 #ifndef CEF_LIBCEF_COMMON_NET_URL_UTIL_H_ 6 #define CEF_LIBCEF_COMMON_NET_URL_UTIL_H_ 7 #pragma once 8 9 #include "include/cef_base.h" 10 11 class GURL; 12 13 namespace url_util { 14 15 // Convert |url| to a GURL, adding a scheme prefix if necessary. 16 // If |fixup| is true then FixupGURL() will also be called. 17 GURL MakeGURL(const CefString& url, bool fixup); 18 19 // Fix common problems with user-typed text. Among other things, this: 20 // - Converts absolute file paths to "file://" URLs. 21 // - Normalizes "about:" and "chrome:" to "chrome://" URLs 22 // Modifies |gurl| if necessary. Returns true if |gurl| is empty or valid. 23 bool FixupGURL(GURL& gurl); 24 25 } // namespace url_util 26 27 #endif // CEF_LIBCEF_COMMON_NET_URL_UTIL_H_ 28