Limit number of opened tabs in brower
[profile/tv/apps/web/browser.git] / core / Config / Config.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include "browser_config.h"
18 #include "Config.h"
19 #include <tzplatform_config.h>
20
21 namespace tizen_browser
22 {
23 namespace config
24 {
25
26 void DefaultConfig::load(const std::string &)
27 {
28     const char *db_path = NULL;
29     db_path = tzplatform_getenv(TZ_USER_APP);
30
31     m_data["main_service_name"] = std::string("org.tizen.browser.base_UI");
32     //m_data["favorite_service_name"] = std::string("org.tizen.browser.service.favorite.browserProvider");
33     m_data["favorite_service_name"] = std::string("org.tizen.browser.favoriteservice");
34     m_data["DB_BOOKMARK"] = std::string(".browser.bookmark.db");
35     m_data["DB_SETTINGS"] = std::string(".browser.settings.db");
36     m_data["DB_HISTORY"] = std::string(".browser.history.db");
37     m_data["DB_SESSION"] = std::string(".browser.session.db");
38
39     m_data["TOOLTIP_DELAY"] = 0.05; // time from mouse in to tooltip show
40     m_data["TOOLTIP_HIDE_TIMEOUT"] = 2.0; // time from tooltip show to tooltip hide
41     m_data["TAB_LIMIT"] = 10;    // max number of open tabs
42     m_data["FAVORITES_LIMIT"] = 40;    // max number of added favorites
43
44 #   include "ConfigValues.h"
45
46     m_data["resourcedb/dir"] = std::string(db_path)+"/"+std::string("org.tizen.browser/data/");
47 }
48
49 void DefaultConfig::store(const std::string & )
50 {
51 }
52
53 boost::any DefaultConfig::get(const std::string & key)
54 {
55         return m_data[key];
56 }
57
58 void DefaultConfig::set(const std::string & key, const boost::any & value)
59 {
60         m_data[key] = value;
61 }
62
63 } /* end of namespace config */
64 } /* end of namespace tizen_browser */