dde11b76375aa2c4d968a7dbe90480f8852fd9c2
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / application_storage.h
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.
4
5 #ifndef XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_H_
6 #define XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_H_
7
8 #include <map>
9 #include <string>
10 #include <vector>
11
12 #include "base/memory/ref_counted.h"
13 #include "xwalk/application/common/application_data.h"
14
15 namespace xwalk {
16 namespace application {
17
18 class ApplicationStorage {
19  public:
20   explicit ApplicationStorage(const base::FilePath& path);
21   ~ApplicationStorage();
22
23   bool AddApplication(scoped_refptr<ApplicationData> app_data);
24
25   bool RemoveApplication(const std::string& app_id);
26
27   bool UpdateApplication(scoped_refptr<ApplicationData> app_data);
28
29   bool Contains(const std::string& app_id) const;
30
31   scoped_refptr<ApplicationData> GetApplicationData(
32       const std::string& app_id) const;
33
34   bool GetInstalledApplicationIDs(
35       std::vector<std::string>& app_ids) const;  // NOLINT
36
37  private:
38   scoped_ptr<class ApplicationStorageImpl> impl_;
39   DISALLOW_COPY_AND_ASSIGN(ApplicationStorage);
40 };
41
42 }  // namespace application
43 }  // namespace xwalk
44
45 #endif  // XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_H_