1/* 2 * Copyright (C) 2011, 2012 Research In Motion Limited. All rights reserved. 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 19#include "config.h" 20#include "IconDatabaseClientBlackBerry.h" 21 22#include "BlackBerryPlatformSettings.h" 23#include "IconDatabase.h" 24#include "WebSettings.h" 25 26namespace WebCore { 27 28SINGLETON_INITIALIZER_THREADUNSAFE(IconDatabaseClientBlackBerry) 29 30bool IconDatabaseClientBlackBerry::initIconDatabase(const BlackBerry::WebKit::WebSettings* settings) 31{ 32 bool enable = !settings->isPrivateBrowsingEnabled() && settings->isDatabasesEnabled(); 33 iconDatabase().setEnabled(enable); 34 if (!enable) { 35 m_initState = NotInitialized; 36 return false; 37 } 38 39 if (m_initState == InitializeFailed) 40 return false; 41 42 if (m_initState == InitializeSucceeded) 43 return true; 44 45 iconDatabase().setClient(this); 46 47 m_initState = iconDatabase().open(BlackBerry::Platform::Settings::instance()->applicationDataDirectory().c_str(), 48 IconDatabase::defaultDatabaseFilename()) ? InitializeSucceeded : InitializeFailed; 49 50 return m_initState == InitializeSucceeded; 51} 52 53void IconDatabaseClientBlackBerry::didRemoveAllIcons() 54{ 55} 56 57void IconDatabaseClientBlackBerry::didImportIconURLForPageURL(const String&) 58{ 59} 60 61void IconDatabaseClientBlackBerry::didImportIconDataForPageURL(const String&) 62{ 63} 64 65void IconDatabaseClientBlackBerry::didChangeIconForPageURL(const String&) 66{ 67} 68 69void IconDatabaseClientBlackBerry::didFinishURLImport() 70{ 71} 72 73} // namespace WebCore 74