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 #ifndef XWALK_APPLICATION_COMMON_APPLICATION_FILE_UTIL_H_
6 #define XWALK_APPLICATION_COMMON_APPLICATION_FILE_UTIL_H_
11 #include "base/memory/ref_counted.h"
12 #include "xwalk/application/common/manifest.h"
18 class DictionaryValue;
22 // Utilities for manipulating the on-disk storage of applications.
24 namespace application {
26 class ApplicationData;
28 // Loads and validates an application from the specified directory. Returns NULL
29 // on failure, with a description of the error in |error|.
30 scoped_refptr<ApplicationData> LoadApplication(
31 const base::FilePath& application_root,
32 Manifest::SourceType source_type,
35 // The same as LoadApplication except use the provided |application_id|.
36 scoped_refptr<ApplicationData> LoadApplication(
37 const base::FilePath& application_root,
38 const std::string& application_id,
39 Manifest::SourceType source_type,
42 // Loads an application manifest from the specified directory. Returns NULL
43 // on failure, with a description of the error in |error|.
44 base::DictionaryValue* LoadManifest(const base::FilePath& application_root,
47 // Get a relative file path from an app:// URL.
48 base::FilePath ApplicationURLToRelativeFilePath(const GURL& url);
50 } // namespace application
53 #endif // XWALK_APPLICATION_COMMON_APPLICATION_FILE_UTIL_H_