blob: ff870ac99528171f8754178d325fbdba7861d4b4 [file] [log] [blame]
[email protected]e7bee3992012-09-27 18:36:261// 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.
4
5#include "android_webview/common/url_constants.h"
6
mnaganovb58eaaa2015-08-13 16:33:327#include "base/strings/string_util.h"
8
[email protected]e7bee3992012-09-27 18:36:269namespace android_webview {
10
[email protected]e7bee3992012-09-27 18:36:2611// 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
14const char kAndroidAssetPath[] = "/android_asset/";
15const char kAndroidResourcePath[] = "/android_res/";
16
[email protected]81778daf2013-10-21 16:19:5217// This scheme is used to display a default HTML5 video poster.
18const char kAndroidWebViewVideoPosterScheme[] = "android-webview-video-poster";
19
mnaganovb58eaaa2015-08-13 16:33:3220bool IsAndroidSpecialFileUrl(const GURL& url) {
21 if (!url.is_valid() || !url.SchemeIsFile() || !url.has_path())
22 return false;
23 return base::StartsWith(url.path(), kAndroidAssetPath,
24 base::CompareCase::SENSITIVE) ||
25 base::StartsWith(url.path(), kAndroidResourcePath,
26 base::CompareCase::SENSITIVE);
27}
28
[email protected]e7bee3992012-09-27 18:36:2629} // namespace android_webview