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
3 // found in the LICENSE file.
5 #include "android_webview/common/url_constants.h"
7 #include "base/strings/string_util.h"
9 namespace android_webview
{
11 // These are special paths used with the file: scheme to access application
12 // assets and resources.
13 // See http://developer.android.com/reference/android/webkit/WebSettings.html
14 const char kAndroidAssetPath
[] = "/android_asset/";
15 const char kAndroidResourcePath
[] = "/android_res/";
17 // This scheme is used to display a default HTML5 video poster.
18 const char kAndroidWebViewVideoPosterScheme
[] = "android-webview-video-poster";
20 bool IsAndroidSpecialFileUrl(const GURL
& url
) {
21 if (!url
.is_valid() || !url
.SchemeIsFile() || !url
.has_path())
23 return base::StartsWith(url
.path(), kAndroidAssetPath
,
24 base::CompareCase::SENSITIVE
) ||
25 base::StartsWith(url
.path(), kAndroidResourcePath
,
26 base::CompareCase::SENSITIVE
);
29 } // namespace android_webview