2
Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3
Copyright (C) 2008 Trolltech ASA
4
Copyright (C) 2008 Collabora Ltd. All rights reserved.
5
Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
6
Copyright (C) 2009-2010 ProFUSION embedded systems
7
Copyright (C) 2009-2011 Samsung Electronics
8
Copyright (C) 2012 Intel Corporation
10
This library is free software; you can redistribute it and/or
11
modify it under the terms of the GNU Library General Public
12
License as published by the Free Software Foundation; either
13
version 2 of the License, or (at your option) any later version.
15
This library is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
Library General Public License for more details.
20
You should have received a copy of the GNU Library General Public License
21
along with this library; see the file COPYING.LIB. If not, write to
22
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23
Boston, MA 02110-1301, USA.
27
#include "PlatformStrategiesEfl.h"
29
#include "NotImplemented.h"
31
#include "PageGroup.h"
32
#include "PlatformCookieJar.h"
33
#include "PluginDatabase.h"
34
#include "PluginPackage.h"
36
using namespace WebCore;
38
void PlatformStrategiesEfl::initialize()
40
DEFINE_STATIC_LOCAL(PlatformStrategiesEfl, platformStrategies, ());
41
setPlatformStrategies(&platformStrategies);
44
PlatformStrategiesEfl::PlatformStrategiesEfl()
48
CookiesStrategy* PlatformStrategiesEfl::createCookiesStrategy()
53
LoaderStrategy* PlatformStrategiesEfl::createLoaderStrategy()
58
PasteboardStrategy* PlatformStrategiesEfl::createPasteboardStrategy()
64
PluginStrategy* PlatformStrategiesEfl::createPluginStrategy()
69
SharedWorkerStrategy* PlatformStrategiesEfl::createSharedWorkerStrategy()
74
VisitedLinkStrategy* PlatformStrategiesEfl::createVisitedLinkStrategy()
80
void PlatformStrategiesEfl::notifyCookiesChanged()
84
String PlatformStrategiesEfl::cookiesForDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url)
86
return WebCore::cookiesForDOM(context, firstParty, url);
89
void PlatformStrategiesEfl::setCookiesFromDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url, const String& cookieString)
91
WebCore::setCookiesFromDOM(context, firstParty, url, cookieString);
94
bool PlatformStrategiesEfl::cookiesEnabled(NetworkingContext* context, const KURL& firstParty, const KURL& url)
96
return WebCore::cookiesEnabled(context, firstParty, url);
99
String PlatformStrategiesEfl::cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstParty, const KURL& url)
101
return WebCore::cookieRequestHeaderFieldValue(context, firstParty, url);
104
bool PlatformStrategiesEfl::getRawCookies(NetworkingContext* context, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
106
return WebCore::getRawCookies(context, firstParty, url, rawCookies);
109
void PlatformStrategiesEfl::deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
111
WebCore::deleteCookie(context, url, cookieName);
114
void PlatformStrategiesEfl::getHostnamesWithCookies(NetworkingContext* context, HashSet<String>& hostnames)
116
WebCore::getHostnamesWithCookies(context, hostnames);
119
void PlatformStrategiesEfl::deleteCookiesForHostname(NetworkingContext* context, const String& hostname)
121
WebCore::deleteCookiesForHostname(context, hostname);
124
void PlatformStrategiesEfl::deleteAllCookies(NetworkingContext* context)
126
WebCore::deleteAllCookies(context);
129
void PlatformStrategiesEfl::refreshPlugins()
131
#if ENABLE(NETSCAPE_PLUGIN_API)
132
PluginDatabase::installedPlugins()->refresh();
136
void PlatformStrategiesEfl::getPluginInfo(const Page*, Vector<PluginInfo>& outPlugins)
138
#if ENABLE(NETSCAPE_PLUGIN_API)
139
PluginDatabase::installedPlugins()->refresh();
140
const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins();
141
outPlugins.resize(plugins.size());
143
for (size_t i = 0; i < plugins.size(); ++i) {
144
PluginPackage* package = plugins[i];
146
PluginInfo pluginInfo;
147
pluginInfo.name = package->name();
148
pluginInfo.file = package->fileName();
149
pluginInfo.desc = package->description();
151
const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
152
MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
153
for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
157
mime.desc = it->value;
158
mime.extensions = package->mimeToExtensions().get(mime.type);
159
pluginInfo.mimes.append(mime);
162
outPlugins.append(pluginInfo);
165
UNUSED_PARAM(outPlugins);
169
// VisitedLinkStrategy
170
bool PlatformStrategiesEfl::isLinkVisited(Page* page, LinkHash hash, const KURL&, const AtomicString&)
172
return page->group().isLinkVisited(hash);
175
void PlatformStrategiesEfl::addVisitedLink(Page* page, LinkHash hash)
177
page->group().addVisitedLinkHash(hash);