1 // Copyright (c) 2014 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_EXTENSION_APPLICATION_WIDGET_STORAGE_H_
6 #define XWALK_APPLICATION_EXTENSION_APPLICATION_WIDGET_STORAGE_H_
11 #include "base/values.h"
12 #include "base/files/file_path.h"
13 #include "sql/connection.h"
14 #include "xwalk/application/browser/application.h"
17 namespace application {
19 class AppWidgetStorage {
21 AppWidgetStorage(Application* application,
22 const base::FilePath& data_dir);
25 // Adds or replaces entry (if not readonly);
26 // returns true on success.
27 bool AddEntry(const std::string& key,
28 const std::string& value,
30 bool RemoveEntry(const std::string& key);
32 bool GetAllEntries(base::DictionaryValue* result);
33 bool EntryExists(const std::string& key) const;
37 bool IsReadOnly(const std::string& key);
38 bool InitStorageTable();
39 bool SaveConfigInfoInDB();
40 bool SaveConfigInfoItem(base::DictionaryValue* dict);
42 Application* application_;
43 scoped_ptr<sql::Connection> sqlite_db_;
44 base::FilePath data_path_;
48 } // namespace application
50 #endif // XWALK_APPLICATION_EXTENSION_APPLICATION_WIDGET_STORAGE_H_