file_util.h revision f2477e01787aa58f445919b809d89e252beef54f
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 3// found in the LICENSE file. 4 5#ifndef EXTENSIONS_COMMON_FILE_UTIL_H_ 6#define EXTENSIONS_COMMON_FILE_UTIL_H_ 7 8class GURL; 9 10namespace base { 11class FilePath; 12} 13 14namespace extensions { 15namespace file_util { 16 17// Get a relative file path from a chrome-extension:// URL. 18base::FilePath ExtensionURLToRelativeFilePath(const GURL& url); 19 20// Get a full file path from a chrome-extension-resource:// URL, If the URL 21// points a file outside of root, this function will return empty FilePath. 22base::FilePath ExtensionResourceURLToFilePath(const GURL& url, 23 const base::FilePath& root); 24 25} // namespace file_util 26} // namespace extensions 27 28#endif // EXTENSIONS_COMMON_FILE_UTIL_H_ 29