~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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
 
9
 
 
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.
 
14
 
 
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.
 
19
 
 
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.
 
24
*/
 
25
 
 
26
#include "config.h"
 
27
#include "PlatformStrategiesEfl.h"
 
28
 
 
29
#include "NotImplemented.h"
 
30
#include "Page.h"
 
31
#include "PageGroup.h"
 
32
#include "PlatformCookieJar.h"
 
33
#include "PluginDatabase.h"
 
34
#include "PluginPackage.h"
 
35
 
 
36
using namespace WebCore;
 
37
 
 
38
void PlatformStrategiesEfl::initialize()
 
39
{
 
40
    DEFINE_STATIC_LOCAL(PlatformStrategiesEfl, platformStrategies, ());
 
41
    setPlatformStrategies(&platformStrategies);
 
42
}
 
43
 
 
44
PlatformStrategiesEfl::PlatformStrategiesEfl()
 
45
{
 
46
}
 
47
 
 
48
CookiesStrategy* PlatformStrategiesEfl::createCookiesStrategy()
 
49
{
 
50
    return this;
 
51
}
 
52
 
 
53
LoaderStrategy* PlatformStrategiesEfl::createLoaderStrategy()
 
54
{
 
55
    return this;
 
56
}
 
57
 
 
58
PasteboardStrategy* PlatformStrategiesEfl::createPasteboardStrategy()
 
59
{
 
60
    notImplemented();
 
61
    return 0;
 
62
}
 
63
 
 
64
PluginStrategy* PlatformStrategiesEfl::createPluginStrategy()
 
65
{
 
66
    return this;
 
67
}
 
68
 
 
69
SharedWorkerStrategy* PlatformStrategiesEfl::createSharedWorkerStrategy()
 
70
{
 
71
    return this;
 
72
}
 
73
 
 
74
VisitedLinkStrategy* PlatformStrategiesEfl::createVisitedLinkStrategy()
 
75
{
 
76
    return this;
 
77
}
 
78
 
 
79
// CookiesStrategy
 
80
void PlatformStrategiesEfl::notifyCookiesChanged()
 
81
{
 
82
}
 
83
 
 
84
String PlatformStrategiesEfl::cookiesForDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url)
 
85
{
 
86
    return WebCore::cookiesForDOM(context, firstParty, url);
 
87
}
 
88
 
 
89
void PlatformStrategiesEfl::setCookiesFromDOM(NetworkingContext* context, const KURL& firstParty, const KURL& url, const String& cookieString)
 
90
{
 
91
    WebCore::setCookiesFromDOM(context, firstParty, url, cookieString);
 
92
}
 
93
 
 
94
bool PlatformStrategiesEfl::cookiesEnabled(NetworkingContext* context, const KURL& firstParty, const KURL& url)
 
95
{
 
96
    return WebCore::cookiesEnabled(context, firstParty, url);
 
97
}
 
98
 
 
99
String PlatformStrategiesEfl::cookieRequestHeaderFieldValue(NetworkingContext* context, const KURL& firstParty, const KURL& url)
 
100
{
 
101
    return WebCore::cookieRequestHeaderFieldValue(context, firstParty, url);
 
102
}
 
103
 
 
104
bool PlatformStrategiesEfl::getRawCookies(NetworkingContext* context, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
 
105
{
 
106
    return WebCore::getRawCookies(context, firstParty, url, rawCookies);
 
107
}
 
108
 
 
109
void PlatformStrategiesEfl::deleteCookie(NetworkingContext* context, const KURL& url, const String& cookieName)
 
110
{
 
111
    WebCore::deleteCookie(context, url, cookieName);
 
112
}
 
113
 
 
114
void PlatformStrategiesEfl::getHostnamesWithCookies(NetworkingContext* context, HashSet<String>& hostnames)
 
115
{
 
116
    WebCore::getHostnamesWithCookies(context, hostnames);
 
117
}
 
118
 
 
119
void PlatformStrategiesEfl::deleteCookiesForHostname(NetworkingContext* context, const String& hostname)
 
120
{
 
121
    WebCore::deleteCookiesForHostname(context, hostname);
 
122
}
 
123
 
 
124
void PlatformStrategiesEfl::deleteAllCookies(NetworkingContext* context)
 
125
{
 
126
    WebCore::deleteAllCookies(context);
 
127
}
 
128
 
 
129
void PlatformStrategiesEfl::refreshPlugins()
 
130
{
 
131
#if ENABLE(NETSCAPE_PLUGIN_API)
 
132
    PluginDatabase::installedPlugins()->refresh();
 
133
#endif
 
134
}
 
135
 
 
136
void PlatformStrategiesEfl::getPluginInfo(const Page*, Vector<PluginInfo>& outPlugins)
 
137
{
 
138
#if ENABLE(NETSCAPE_PLUGIN_API)
 
139
    PluginDatabase::installedPlugins()->refresh();
 
140
    const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins();
 
141
    outPlugins.resize(plugins.size());
 
142
 
 
143
    for (size_t i = 0; i < plugins.size(); ++i) {
 
144
        PluginPackage* package = plugins[i];
 
145
 
 
146
        PluginInfo pluginInfo;
 
147
        pluginInfo.name = package->name();
 
148
        pluginInfo.file = package->fileName();
 
149
        pluginInfo.desc = package->description();
 
150
 
 
151
        const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
 
152
        MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
 
153
        for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
 
154
            MimeClassInfo mime;
 
155
 
 
156
            mime.type = it->key;
 
157
            mime.desc = it->value;
 
158
            mime.extensions = package->mimeToExtensions().get(mime.type);
 
159
            pluginInfo.mimes.append(mime);
 
160
        }
 
161
 
 
162
        outPlugins.append(pluginInfo);
 
163
    }
 
164
#else
 
165
    UNUSED_PARAM(outPlugins);
 
166
#endif
 
167
}
 
168
 
 
169
// VisitedLinkStrategy
 
170
bool PlatformStrategiesEfl::isLinkVisited(Page* page, LinkHash hash, const KURL&, const AtomicString&)
 
171
{
 
172
    return page->group().isLinkVisited(hash);
 
173
}
 
174
 
 
175
void PlatformStrategiesEfl::addVisitedLink(Page* page, LinkHash hash)
 
176
{
 
177
    page->group().addVisitedLinkHash(hash);
 
178
}