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/browser/installer/package.h"
13 #include "xwalk/application/common/manifest.h"
19 class DictionaryValue;
23 // Utilities for manipulating the on-disk storage of applications.
25 namespace application {
27 class ApplicationData;
29 // Loads and validates an application from the specified directory. Returns NULL
30 // on failure, with a description of the error in |error|.
31 scoped_refptr<ApplicationData> LoadApplication(
32 const base::FilePath& application_root,
33 Manifest::SourceType source_type,
36 // The same as LoadApplication except use the provided |application_id|.
37 scoped_refptr<ApplicationData> LoadApplication(
38 const base::FilePath& application_root,
39 const std::string& application_id,
40 Manifest::SourceType source_type,
41 Package::Type package_type,
44 // Loads an application manifest from the specified directory. Returns NULL
45 // on failure, with a description of the error in |error|.
46 base::DictionaryValue* LoadManifest(const base::FilePath& application_root,
47 Package::Type package_type,
50 // Get a relative file path from an app:// URL.
51 base::FilePath ApplicationURLToRelativeFilePath(const GURL& url);
53 } // namespace application
56 #endif // XWALK_APPLICATION_COMMON_APPLICATION_FILE_UTIL_H_