1 // Copyright (c) 2013 Intel Corporation. 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_STORAGE_H_
6 #define XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_H_
12 #include "base/memory/ref_counted.h"
13 #include "xwalk/application/common/application_data.h"
16 namespace application {
18 class ApplicationStorage {
20 explicit ApplicationStorage(const base::FilePath& path);
21 ~ApplicationStorage();
23 bool AddApplication(scoped_refptr<ApplicationData> app_data);
25 bool RemoveApplication(const std::string& app_id);
27 bool UpdateApplication(scoped_refptr<ApplicationData> app_data);
29 bool Contains(const std::string& app_id) const;
31 scoped_refptr<ApplicationData> GetApplicationData(
32 const std::string& app_id) const;
33 // Note: Do not use this method! It is too heavy and it will be
35 bool GetInstalledApplications(
36 ApplicationData::ApplicationDataMap& apps) const; // NOLINT
38 bool GetInstalledApplicationIDs(
39 std::vector<std::string>& app_ids) const; // NOLINT
42 scoped_ptr<class ApplicationStorageImpl> impl_;
43 DISALLOW_COPY_AND_ASSIGN(ApplicationStorage);
46 } // namespace application
49 #endif // XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_H_