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_BROWSER_APPLICATION_STORAGE_H_
6 #define XWALK_APPLICATION_BROWSER_APPLICATION_STORAGE_H_
12 #include "base/memory/ref_counted.h"
13 #include "base/observer_list.h"
14 #include "xwalk/application/common/application_data.h"
17 namespace application {
19 class ApplicationStorage {
21 explicit ApplicationStorage(const base::FilePath& path);
22 ~ApplicationStorage();
24 bool AddApplication(scoped_refptr<ApplicationData> app_data);
26 bool RemoveApplication(const std::string& id);
28 bool UpdateApplication(scoped_refptr<ApplicationData> app_data);
30 bool Contains(const std::string& app_id) const;
32 scoped_refptr<ApplicationData> GetApplicationData(
33 const std::string& application_id) const;
35 const ApplicationData::ApplicationDataMap& GetInstalledApplications() const;
38 bool Insert(scoped_refptr<ApplicationData> app_data);
39 base::FilePath data_path_;
40 scoped_ptr<class ApplicationStorageImpl> impl_;
41 ApplicationData::ApplicationDataMap applications_;
42 DISALLOW_COPY_AND_ASSIGN(ApplicationStorage);
45 } // namespace application
48 #endif // XWALK_APPLICATION_BROWSER_APPLICATION_STORAGE_H_