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