[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
aroben at apple.com
aroben at apple.com
Wed Dec 22 11:42:23 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 34e4981e340dca57f35b9de17cc1b604fe0996a3
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 4 13:00:50 2010 +0000
Turn on PLATFORM_STRATEGIES on Windows
Fixes <http://webkit.org/b/43431>.
Reviewed by Anders Carlsson.
JavaScriptCore:
* wtf/Platform.h:
WebCore:
* WebCore.vcproj/WebCore.vcproj: Added LocalizedStrings.cpp,
PlatformStrategies.h, LocalizationStrategy.h, PluginStrategy.h, and
VisitedLinkStrategy.h. Removed PluginDataWin.cpp
* platform/LocalizedStrings.cpp: Wrapped Mac-only functions in
PLATFORM(MAC) guards.
(WebCore::uploadFileText):
(WebCore::allFilesText):
Added these Windows-only functions.
* plugins/win/PluginDataWin.cpp: Removed.
WebKit/win:
* WebCoreLocalizedStrings.cpp: Removed.
* WebCoreSupport/WebPlatformStrategies.cpp: Added. Based on the Mac
equivalent.
(WebPlatformStrategies::initialize): Creates the singleton instance.
(WebPlatformStrategies::WebPlatformStrategies): Registers the
singleton instance as the PlatformStrategies instance for WebCore.
(WebPlatformStrategies::createPluginStrategy):
(WebPlatformStrategies::createLocalizationStrategy):
(WebPlatformStrategies::createVisitedLinkStrategy):
Return ourselves as the strategy.
(WebPlatformStrategies::refreshPlugins):
(WebPlatformStrategies::getPluginInfo):
Moved code here from WebCore's PluginDataWin.cpp file.
(WebPlatformStrategies::searchableIndexIntroduction):
(WebPlatformStrategies::submitButtonDefaultLabel):
(WebPlatformStrategies::inputElementAltText):
(WebPlatformStrategies::resetButtonDefaultLabel):
(WebPlatformStrategies::fileButtonChooseFileLabel):
(WebPlatformStrategies::fileButtonNoFileSelectedLabel):
(WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow):
(WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk):
(WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard):
(WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow):
(WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk):
(WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard):
(WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow):
(WebPlatformStrategies::contextMenuItemTagCopy):
(WebPlatformStrategies::contextMenuItemTagGoBack):
(WebPlatformStrategies::contextMenuItemTagGoForward):
(WebPlatformStrategies::contextMenuItemTagStop):
(WebPlatformStrategies::contextMenuItemTagReload):
(WebPlatformStrategies::contextMenuItemTagCut):
(WebPlatformStrategies::contextMenuItemTagPaste):
(WebPlatformStrategies::contextMenuItemTagNoGuessesFound):
(WebPlatformStrategies::contextMenuItemTagIgnoreSpelling):
(WebPlatformStrategies::contextMenuItemTagLearnSpelling):
(WebPlatformStrategies::contextMenuItemTagSearchWeb):
(WebPlatformStrategies::contextMenuItemTagLookUpInDictionary):
(WebPlatformStrategies::contextMenuItemTagOpenLink):
(WebPlatformStrategies::contextMenuItemTagIgnoreGrammar):
(WebPlatformStrategies::contextMenuItemTagSpellingMenu):
(WebPlatformStrategies::contextMenuItemTagCheckSpelling):
(WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping):
(WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling):
(WebPlatformStrategies::contextMenuItemTagFontMenu):
(WebPlatformStrategies::contextMenuItemTagBold):
(WebPlatformStrategies::contextMenuItemTagItalic):
(WebPlatformStrategies::contextMenuItemTagUnderline):
(WebPlatformStrategies::contextMenuItemTagOutline):
(WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu):
(WebPlatformStrategies::contextMenuItemTagTextDirectionMenu):
(WebPlatformStrategies::contextMenuItemTagDefaultDirection):
(WebPlatformStrategies::contextMenuItemTagLeftToRight):
(WebPlatformStrategies::contextMenuItemTagRightToLeft):
(WebPlatformStrategies::contextMenuItemTagShowSpellingPanel):
(WebPlatformStrategies::contextMenuItemTagInspectElement):
(WebPlatformStrategies::searchMenuNoRecentSearchesText):
(WebPlatformStrategies::searchMenuRecentSearchesText):
(WebPlatformStrategies::searchMenuClearRecentSearchesText):
(WebPlatformStrategies::AXWebAreaText):
(WebPlatformStrategies::AXLinkText):
(WebPlatformStrategies::AXListMarkerText):
(WebPlatformStrategies::AXImageMapText):
(WebPlatformStrategies::AXHeadingText):
(WebPlatformStrategies::AXDefinitionListTermText):
(WebPlatformStrategies::AXDefinitionListDefinitionText):
(WebPlatformStrategies::AXButtonActionVerb):
(WebPlatformStrategies::AXRadioButtonActionVerb):
(WebPlatformStrategies::AXTextFieldActionVerb):
(WebPlatformStrategies::AXCheckedCheckBoxActionVerb):
(WebPlatformStrategies::AXUncheckedCheckBoxActionVerb):
(WebPlatformStrategies::AXLinkActionVerb):
(WebPlatformStrategies::AXMenuListActionVerb):
(WebPlatformStrategies::AXMenuListPopupActionVerb):
(WebPlatformStrategies::unknownFileSizeText):
(WebPlatformStrategies::uploadFileText):
(WebPlatformStrategies::allFilesText):
(WebPlatformStrategies::missingPluginText):
(WebPlatformStrategies::crashedPluginText):
(WebPlatformStrategies::imageTitle):
(WebPlatformStrategies::multipleFileUploadText):
(WebPlatformStrategies::mediaElementLoadingStateText):
(WebPlatformStrategies::mediaElementLiveBroadcastStateText):
(WebPlatformStrategies::localizedMediaControlElementString):
(WebPlatformStrategies::localizedMediaControlElementHelpText):
(WebPlatformStrategies::localizedMediaTimeDescription):
(WebPlatformStrategies::validationMessageValueMissingText):
(WebPlatformStrategies::validationMessageTypeMismatchText):
(WebPlatformStrategies::validationMessagePatternMismatchText):
(WebPlatformStrategies::validationMessageTooLongText):
(WebPlatformStrategies::validationMessageRangeUnderflowText):
(WebPlatformStrategies::validationMessageRangeOverflowText):
(WebPlatformStrategies::validationMessageStepMismatchText):
Moved code here from WebCoreLocalizedStrings.cpp (and slightly cleaned
it up).
(WebPlatformStrategies::isLinkVisited):
(WebPlatformStrategies::addVisitedLink):
Copied code from WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm.
* WebCoreSupport/WebPlatformStrategies.h: Added.
* WebKit.vcproj/WebKit.vcproj: Removed WebCoreLocalizedStrings, added
WebPlatformStrategies.
* WebView.cpp:
(WebView::initWithFrame): Initialize WebPlatformStrategies.
WebKit2:
* win/WebKit2.vcproj: Added WebPlatformStrategies. Also let VS reorder
this file as it saw fit.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index c55f458..bafe699 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-03 Adam Roben <aroben at apple.com>
+
+ Turn on PLATFORM_STRATEGIES on Windows
+
+ Fixes <http://webkit.org/b/43431>.
+
+ Reviewed by Anders Carlsson.
+
+ * wtf/Platform.h:
+
2010-08-04 Gabor Loki <loki at webkit.org>
Reviewed by Geoffrey Garen.
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index 187649c..3e8c7d6 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -1074,7 +1074,7 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
#define ENABLE_JSC_ZOMBIES 0
/* FIXME: Eventually we should enable this for all platforms and get rid of the define. */
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) || PLATFORM(WIN)
#define WTF_USE_PLATFORM_STRATEGIES 1
#endif
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 72d08e2..aae22eb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-08-03 Adam Roben <aroben at apple.com>
+
+ Turn on PLATFORM_STRATEGIES on Windows
+
+ Fixes <http://webkit.org/b/43431>.
+
+ Reviewed by Anders Carlsson.
+
+ * WebCore.vcproj/WebCore.vcproj: Added LocalizedStrings.cpp,
+ PlatformStrategies.h, LocalizationStrategy.h, PluginStrategy.h, and
+ VisitedLinkStrategy.h. Removed PluginDataWin.cpp
+
+ * platform/LocalizedStrings.cpp: Wrapped Mac-only functions in
+ PLATFORM(MAC) guards.
+
+ (WebCore::uploadFileText):
+ (WebCore::allFilesText):
+ Added these Windows-only functions.
+
+ * plugins/win/PluginDataWin.cpp: Removed.
+
2010-08-04 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 1685261..c0dc3be 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -23341,6 +23341,14 @@
>
</File>
<File
+ RelativePath="..\platform\LocalizationStrategy.h"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\LocalizedStrings.cpp"
+ >
+ </File>
+ <File
RelativePath="..\platform\LocalizedStrings.h"
>
</File>
@@ -23389,6 +23397,14 @@
>
</File>
<File
+ RelativePath="..\platform\PlatformStrategies.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\PlatformStrategies.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\PlatformWheelEvent.h"
>
</File>
@@ -23537,6 +23553,10 @@
>
</File>
<File
+ RelativePath="..\platform\VisitedLinkStrategy.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\Widget.cpp"
>
</File>
@@ -48541,6 +48561,10 @@
>
</File>
<File
+ RelativePath="..\plugins\PluginStrategy.h"
+ >
+ </File>
+ <File
RelativePath="..\plugins\PluginStream.cpp"
>
</File>
@@ -48564,10 +48588,6 @@
>
</File>
<File
- RelativePath="..\plugins\win\PluginDataWin.cpp"
- >
- </File>
- <File
RelativePath="..\plugins\win\PluginMessageThrottlerWin.cpp"
>
</File>
diff --git a/WebCore/platform/LocalizedStrings.cpp b/WebCore/platform/LocalizedStrings.cpp
index c23b742..61100e0 100644
--- a/WebCore/platform/LocalizedStrings.cpp
+++ b/WebCore/platform/LocalizedStrings.cpp
@@ -63,10 +63,12 @@ String fileButtonNoFileSelectedLabel()
return platformStrategies()->localizationStrategy()->fileButtonNoFileSelectedLabel();
}
+#if PLATFORM(MAC)
String copyImageUnknownFileLabel()
{
return platformStrategies()->localizationStrategy()->copyImageUnknownFileLabel();
}
+#endif
#if ENABLE(CONTEXT_MENUS)
String contextMenuItemTagOpenLinkInNewWindow()
@@ -154,10 +156,12 @@ String contextMenuItemTagLearnSpelling()
return platformStrategies()->localizationStrategy()->contextMenuItemTagLearnSpelling();
}
+#if PLATFORM(MAC)
String contextMenuItemTagSearchInSpotlight()
{
return platformStrategies()->localizationStrategy()->contextMenuItemTagSearchInSpotlight();
}
+#endif
String contextMenuItemTagSearchWeb()
{
@@ -209,10 +213,12 @@ String contextMenuItemTagFontMenu()
return platformStrategies()->localizationStrategy()->contextMenuItemTagFontMenu();
}
+#if PLATFORM(MAC)
String contextMenuItemTagShowFonts()
{
return platformStrategies()->localizationStrategy()->contextMenuItemTagShowFonts();
}
+#endif
String contextMenuItemTagBold()
{
@@ -234,6 +240,7 @@ String contextMenuItemTagOutline()
return platformStrategies()->localizationStrategy()->contextMenuItemTagOutline();
}
+#if PLATFORM(MAC)
String contextMenuItemTagStyles()
{
return platformStrategies()->localizationStrategy()->contextMenuItemTagStyles();
@@ -258,6 +265,7 @@ String contextMenuItemTagStopSpeaking()
{
return platformStrategies()->localizationStrategy()->contextMenuItemTagStopSpeaking();
}
+#endif
String contextMenuItemTagWritingDirectionMenu()
{
@@ -284,6 +292,8 @@ String contextMenuItemTagRightToLeft()
return platformStrategies()->localizationStrategy()->contextMenuItemTagRightToLeft();
}
+#if PLATFORM(MAC)
+
String contextMenuItemTagCorrectSpellingAutomatically()
{
return platformStrategies()->localizationStrategy()->contextMenuItemTagCorrectSpellingAutomatically();
@@ -348,6 +358,8 @@ String contextMenuItemTagChangeBack(const String& replacedString)
{
return platformStrategies()->localizationStrategy()->contextMenuItemTagChangeBack(replacedString);
}
+
+#endif // PLATFORM(MAC)
String contextMenuItemTagInspectElement()
{
@@ -406,10 +418,12 @@ String AXDefinitionListDefinitionText()
return platformStrategies()->localizationStrategy()->AXDefinitionListDefinitionText();
}
+#if PLATFORM(MAC)
String AXARIAContentGroupText(const String& ariaType)
{
return platformStrategies()->localizationStrategy()->AXARIAContentGroupText(ariaType);
}
+#endif
String AXButtonActionVerb()
{
@@ -471,6 +485,18 @@ String unknownFileSizeText()
return platformStrategies()->localizationStrategy()->unknownFileSizeText();
}
+#if PLATFORM(WIN)
+String uploadFileText()
+{
+ return platformStrategies()->localizationStrategy()->uploadFileText();
+}
+
+String allFilesText()
+{
+ return platformStrategies()->localizationStrategy()->allFilesText();
+}
+#endif
+
String imageTitle(const String& filename, const IntSize& size)
{
return platformStrategies()->localizationStrategy()->imageTitle(filename, size);
diff --git a/WebCore/plugins/win/PluginDataWin.cpp b/WebCore/plugins/win/PluginDataWin.cpp
deleted file mode 100644
index 41fe073..0000000
--- a/WebCore/plugins/win/PluginDataWin.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-#include "PluginData.h"
-
-#include "PluginDatabase.h"
-#include "PluginPackage.h"
-
-namespace WebCore {
-
-void PluginData::initPlugins()
-{
- PluginDatabase *db = PluginDatabase::installedPlugins();
- const Vector<PluginPackage*> &plugins = db->plugins();
-
- for (unsigned int i = 0; i < plugins.size(); ++i) {
- PluginPackage* package = plugins[i];
-
- PluginInfo info;
- info.name = package->name();
- info.file = package->fileName();
- info.desc = package->description();
-
- const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
- MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
- for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
- MimeClassInfo mime;
-
- mime.type = it->first;
- mime.desc = it->second;
- mime.extensions = package->mimeToExtensions().get(mime.type);
-
- info.mimes.append(mime);
- }
-
- m_plugins.append(info);
- }
-}
-
-void PluginData::refresh()
-{
- PluginDatabase *db = PluginDatabase::installedPlugins();
- db->refresh();
-}
-
-};
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 2de212e..7a208fe 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,122 @@
+2010-08-03 Adam Roben <aroben at apple.com>
+
+ Turn on PLATFORM_STRATEGIES on Windows
+
+ Fixes <http://webkit.org/b/43431>.
+
+ Reviewed by Anders Carlsson.
+
+ * WebCoreLocalizedStrings.cpp: Removed.
+ * WebCoreSupport/WebPlatformStrategies.cpp: Added. Based on the Mac
+ equivalent.
+ (WebPlatformStrategies::initialize): Creates the singleton instance.
+ (WebPlatformStrategies::WebPlatformStrategies): Registers the
+ singleton instance as the PlatformStrategies instance for WebCore.
+
+ (WebPlatformStrategies::createPluginStrategy):
+ (WebPlatformStrategies::createLocalizationStrategy):
+ (WebPlatformStrategies::createVisitedLinkStrategy):
+ Return ourselves as the strategy.
+
+ (WebPlatformStrategies::refreshPlugins):
+ (WebPlatformStrategies::getPluginInfo):
+ Moved code here from WebCore's PluginDataWin.cpp file.
+
+ (WebPlatformStrategies::searchableIndexIntroduction):
+ (WebPlatformStrategies::submitButtonDefaultLabel):
+ (WebPlatformStrategies::inputElementAltText):
+ (WebPlatformStrategies::resetButtonDefaultLabel):
+ (WebPlatformStrategies::fileButtonChooseFileLabel):
+ (WebPlatformStrategies::fileButtonNoFileSelectedLabel):
+ (WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk):
+ (WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk):
+ (WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard):
+ (WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow):
+ (WebPlatformStrategies::contextMenuItemTagCopy):
+ (WebPlatformStrategies::contextMenuItemTagGoBack):
+ (WebPlatformStrategies::contextMenuItemTagGoForward):
+ (WebPlatformStrategies::contextMenuItemTagStop):
+ (WebPlatformStrategies::contextMenuItemTagReload):
+ (WebPlatformStrategies::contextMenuItemTagCut):
+ (WebPlatformStrategies::contextMenuItemTagPaste):
+ (WebPlatformStrategies::contextMenuItemTagNoGuessesFound):
+ (WebPlatformStrategies::contextMenuItemTagIgnoreSpelling):
+ (WebPlatformStrategies::contextMenuItemTagLearnSpelling):
+ (WebPlatformStrategies::contextMenuItemTagSearchWeb):
+ (WebPlatformStrategies::contextMenuItemTagLookUpInDictionary):
+ (WebPlatformStrategies::contextMenuItemTagOpenLink):
+ (WebPlatformStrategies::contextMenuItemTagIgnoreGrammar):
+ (WebPlatformStrategies::contextMenuItemTagSpellingMenu):
+ (WebPlatformStrategies::contextMenuItemTagCheckSpelling):
+ (WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping):
+ (WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling):
+ (WebPlatformStrategies::contextMenuItemTagFontMenu):
+ (WebPlatformStrategies::contextMenuItemTagBold):
+ (WebPlatformStrategies::contextMenuItemTagItalic):
+ (WebPlatformStrategies::contextMenuItemTagUnderline):
+ (WebPlatformStrategies::contextMenuItemTagOutline):
+ (WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu):
+ (WebPlatformStrategies::contextMenuItemTagTextDirectionMenu):
+ (WebPlatformStrategies::contextMenuItemTagDefaultDirection):
+ (WebPlatformStrategies::contextMenuItemTagLeftToRight):
+ (WebPlatformStrategies::contextMenuItemTagRightToLeft):
+ (WebPlatformStrategies::contextMenuItemTagShowSpellingPanel):
+ (WebPlatformStrategies::contextMenuItemTagInspectElement):
+ (WebPlatformStrategies::searchMenuNoRecentSearchesText):
+ (WebPlatformStrategies::searchMenuRecentSearchesText):
+ (WebPlatformStrategies::searchMenuClearRecentSearchesText):
+ (WebPlatformStrategies::AXWebAreaText):
+ (WebPlatformStrategies::AXLinkText):
+ (WebPlatformStrategies::AXListMarkerText):
+ (WebPlatformStrategies::AXImageMapText):
+ (WebPlatformStrategies::AXHeadingText):
+ (WebPlatformStrategies::AXDefinitionListTermText):
+ (WebPlatformStrategies::AXDefinitionListDefinitionText):
+ (WebPlatformStrategies::AXButtonActionVerb):
+ (WebPlatformStrategies::AXRadioButtonActionVerb):
+ (WebPlatformStrategies::AXTextFieldActionVerb):
+ (WebPlatformStrategies::AXCheckedCheckBoxActionVerb):
+ (WebPlatformStrategies::AXUncheckedCheckBoxActionVerb):
+ (WebPlatformStrategies::AXLinkActionVerb):
+ (WebPlatformStrategies::AXMenuListActionVerb):
+ (WebPlatformStrategies::AXMenuListPopupActionVerb):
+ (WebPlatformStrategies::unknownFileSizeText):
+ (WebPlatformStrategies::uploadFileText):
+ (WebPlatformStrategies::allFilesText):
+ (WebPlatformStrategies::missingPluginText):
+ (WebPlatformStrategies::crashedPluginText):
+ (WebPlatformStrategies::imageTitle):
+ (WebPlatformStrategies::multipleFileUploadText):
+ (WebPlatformStrategies::mediaElementLoadingStateText):
+ (WebPlatformStrategies::mediaElementLiveBroadcastStateText):
+ (WebPlatformStrategies::localizedMediaControlElementString):
+ (WebPlatformStrategies::localizedMediaControlElementHelpText):
+ (WebPlatformStrategies::localizedMediaTimeDescription):
+ (WebPlatformStrategies::validationMessageValueMissingText):
+ (WebPlatformStrategies::validationMessageTypeMismatchText):
+ (WebPlatformStrategies::validationMessagePatternMismatchText):
+ (WebPlatformStrategies::validationMessageTooLongText):
+ (WebPlatformStrategies::validationMessageRangeUnderflowText):
+ (WebPlatformStrategies::validationMessageRangeOverflowText):
+ (WebPlatformStrategies::validationMessageStepMismatchText):
+ Moved code here from WebCoreLocalizedStrings.cpp (and slightly cleaned
+ it up).
+
+ (WebPlatformStrategies::isLinkVisited):
+ (WebPlatformStrategies::addVisitedLink):
+ Copied code from WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm.
+
+ * WebCoreSupport/WebPlatformStrategies.h: Added.
+
+ * WebKit.vcproj/WebKit.vcproj: Removed WebCoreLocalizedStrings, added
+ WebPlatformStrategies.
+
+ * WebView.cpp:
+ (WebView::initWithFrame): Initialize WebPlatformStrategies.
+
2010-08-03 Alexey Proskuryakov <ap at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit/win/WebCoreLocalizedStrings.cpp b/WebKit/win/WebCoreLocalizedStrings.cpp
deleted file mode 100644
index 2d2f17f..0000000
--- a/WebKit/win/WebCoreLocalizedStrings.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebLocalizableStrings.h"
-#include <WebCore/IntSize.h>
-#include <WebCore/LocalizedStrings.h>
-#include <WebCore/PlatformString.h>
-#include <wtf/MathExtras.h>
-#include <wtf/RetainPtr.h>
-
-using namespace WebCore;
-
-String WebCore::searchableIndexIntroduction() { return String(LPCTSTR_UI_STRING("This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'")); }
-String WebCore::submitButtonDefaultLabel() { return String(LPCTSTR_UI_STRING("Submit", "default label for Submit buttons in forms on web pages")); }
-String WebCore::inputElementAltText() { return String(LPCTSTR_UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value")); }
-String WebCore::resetButtonDefaultLabel() { return String(LPCTSTR_UI_STRING("Reset", "default label for Reset buttons in forms on web pages")); }
-String WebCore::fileButtonChooseFileLabel() { return String(LPCTSTR_UI_STRING("Choose File", "title for file button used in HTML forms")); }
-String WebCore::fileButtonNoFileSelectedLabel() { return String(LPCTSTR_UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected")); }
-String WebCore::contextMenuItemTagOpenLinkInNewWindow() { return String(LPCTSTR_UI_STRING("Open Link in New Window", "Open in New Window context menu item")); }
-String WebCore::contextMenuItemTagDownloadLinkToDisk() { return String(LPCTSTR_UI_STRING("Download Linked File", "Download Linked File context menu item")); }
-String WebCore::contextMenuItemTagCopyLinkToClipboard() { return String(LPCTSTR_UI_STRING("Copy Link", "Copy Link context menu item")); }
-String WebCore::contextMenuItemTagOpenImageInNewWindow() { return String(LPCTSTR_UI_STRING("Open Image in New Window", "Open Image in New Window context menu item")); }
-String WebCore::contextMenuItemTagDownloadImageToDisk() { return String(LPCTSTR_UI_STRING("Download Image", "Download Image context menu item")); }
-String WebCore::contextMenuItemTagCopyImageToClipboard() { return String(LPCTSTR_UI_STRING("Copy Image", "Copy Image context menu item")); }
-String WebCore::contextMenuItemTagOpenFrameInNewWindow() { return String(LPCTSTR_UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item")); }
-String WebCore::contextMenuItemTagCopy() { return String(LPCTSTR_UI_STRING("Copy", "Copy context menu item")); }
-String WebCore::contextMenuItemTagGoBack() { return String(LPCTSTR_UI_STRING("Back", "Back context menu item")); }
-String WebCore::contextMenuItemTagGoForward() { return String(LPCTSTR_UI_STRING("Forward", "Forward context menu item")); }
-String WebCore::contextMenuItemTagStop() { return String(LPCTSTR_UI_STRING("Stop", "Stop context menu item")); }
-String WebCore::contextMenuItemTagReload() { return String(LPCTSTR_UI_STRING("Reload", "Reload context menu item")); }
-String WebCore::contextMenuItemTagCut() { return String(LPCTSTR_UI_STRING("Cut", "Cut context menu item")); }
-String WebCore::contextMenuItemTagPaste() { return String(LPCTSTR_UI_STRING("Paste", "Paste context menu item")); }
-String WebCore::contextMenuItemTagNoGuessesFound() { return String(LPCTSTR_UI_STRING("No Guesses Found", "No Guesses Found context menu item")); }
-String WebCore::contextMenuItemTagIgnoreSpelling() { return String(LPCTSTR_UI_STRING("Ignore Spelling", "Ignore Spelling context menu item")); }
-String WebCore::contextMenuItemTagLearnSpelling() { return String(LPCTSTR_UI_STRING("Learn Spelling", "Learn Spelling context menu item")); }
-String WebCore::contextMenuItemTagSearchWeb() { return String(LPCTSTR_UI_STRING("Search with Google", "Search in Google context menu item")); }
-String WebCore::contextMenuItemTagLookUpInDictionary() { return String(LPCTSTR_UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item")); }
-String WebCore::contextMenuItemTagOpenLink() { return String(LPCTSTR_UI_STRING("Open Link", "Open Link context menu item")); }
-String WebCore::contextMenuItemTagIgnoreGrammar() { return String(LPCTSTR_UI_STRING("Ignore Grammar", "Ignore Grammar context menu item")); }
-String WebCore::contextMenuItemTagSpellingMenu() { return String(LPCTSTR_UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item")); }
-String WebCore::contextMenuItemTagCheckSpelling() { return String(LPCTSTR_UI_STRING("Check Document Now", "Check spelling context menu item")); }
-String WebCore::contextMenuItemTagCheckSpellingWhileTyping() { return String(LPCTSTR_UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item")); }
-String WebCore::contextMenuItemTagCheckGrammarWithSpelling() { return String(LPCTSTR_UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item")); }
-String WebCore::contextMenuItemTagFontMenu() { return String(LPCTSTR_UI_STRING("Font", "Font context sub-menu item")); }
-String WebCore::contextMenuItemTagBold() { return String(LPCTSTR_UI_STRING("Bold", "Bold context menu item")); }
-String WebCore::contextMenuItemTagItalic() { return String(LPCTSTR_UI_STRING("Italic", "Italic context menu item")); }
-String WebCore::contextMenuItemTagUnderline() { return String(LPCTSTR_UI_STRING("Underline", "Underline context menu item")); }
-String WebCore::contextMenuItemTagOutline() { return String(LPCTSTR_UI_STRING("Outline", "Outline context menu item")); }
-String WebCore::contextMenuItemTagWritingDirectionMenu() { return String(LPCTSTR_UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item")); }
-String WebCore::contextMenuItemTagTextDirectionMenu() { return String(LPCTSTR_UI_STRING("Selection Direction", "Selection direction context sub-menu item")); }
-String WebCore::contextMenuItemTagDefaultDirection() { return String(LPCTSTR_UI_STRING("Default", "Default writing direction context menu item")); }
-String WebCore::contextMenuItemTagLeftToRight() { return String(LPCTSTR_UI_STRING("Left to Right", "Left to Right context menu item")); }
-String WebCore::contextMenuItemTagRightToLeft() { return String(LPCTSTR_UI_STRING("Right to Left", "Right to Left context menu item")); }
-String WebCore::contextMenuItemTagShowSpellingPanel(bool show) { return String(show ? LPCTSTR_UI_STRING("Show Spelling and Grammar", "menu item title") : LPCTSTR_UI_STRING("Hide Spelling and Grammar", "menu item title")); }
-String WebCore::contextMenuItemTagInspectElement() { return String(LPCTSTR_UI_STRING("Inspect Element", "Inspect Element context menu item")); }
-String WebCore::searchMenuNoRecentSearchesText() { return String(LPCTSTR_UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed")); }
-String WebCore::searchMenuRecentSearchesText() { return String(LPCTSTR_UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title")); }
-String WebCore::searchMenuClearRecentSearchesText() { return String(LPCTSTR_UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents")); }
-String WebCore::AXWebAreaText() { return String(LPCTSTR_UI_STRING("web area", "accessibility role description for web area")); }
-String WebCore::AXLinkText() { return String(LPCTSTR_UI_STRING("link", "accessibility role description for link")); }
-String WebCore::AXListMarkerText() { return String(LPCTSTR_UI_STRING("list marker", "accessibility role description for list marker")); }
-String WebCore::AXImageMapText() { return String(LPCTSTR_UI_STRING("image map", "accessibility role description for image map")); }
-String WebCore::AXHeadingText() { return String(LPCTSTR_UI_STRING("heading", "accessibility role description for headings")); }
-String WebCore::AXDefinitionListTermText() { return String(LPCTSTR_UI_STRING("term", "term word of a definition")); }
-String WebCore::AXDefinitionListDefinitionText() { return String(LPCTSTR_UI_STRING("definition", "definition phrase")); }
-String WebCore::AXButtonActionVerb() { return String(LPCTSTR_UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility")); }
-String WebCore::AXRadioButtonActionVerb() { return String(LPCTSTR_UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility")); }
-String WebCore::AXTextFieldActionVerb() { return String(LPCTSTR_UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility")); }
-String WebCore::AXCheckedCheckBoxActionVerb() { return String(LPCTSTR_UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility")); }
-String WebCore::AXUncheckedCheckBoxActionVerb() { return String(LPCTSTR_UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility")); }
-String WebCore::AXLinkActionVerb() { return String(LPCTSTR_UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility")); }
-String WebCore::AXMenuListActionVerb() { return String(LPCTSTR_UI_STRING("open", "Verb stating the action that will occur when a select element is clicked, as used by accessibility")); }
-String WebCore::AXMenuListPopupActionVerb() { return String(LPCTSTR_UI_STRING_KEY("press", "press (select element)", "Verb stating the action that will occur when a select element's popup list is clicked, as used by accessibility")); }
-String WebCore::unknownFileSizeText() { return String(LPCTSTR_UI_STRING("Unknown", "Unknown filesize FTP directory listing item")); }
-String WebCore::uploadFileText() { return String(LPCTSTR_UI_STRING("Upload file", "(Windows) Form submit file upload dialog title")); }
-String WebCore::allFilesText() { return String(LPCTSTR_UI_STRING("All Files", "(Windows) Form submit file upload all files pop-up")); }
-String WebCore::missingPluginText() { return String(LPCTSTR_UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing")); }
-String WebCore::crashedPluginText() { return String(LPCTSTR_UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed")); }
-String WebCore::imageTitle(const String& filename, const IntSize& size)
-{
- static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%@ %d\xC3\x97%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"));
-
- RetainPtr<CFStringRef> filenameCF(AdoptCF, filename.createCFString());
- RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), filenameCF.get(), size.width(), size.height()));
-
- return result.get();
-}
-
-String multipleFileUploadText(unsigned numberOfFiles)
-{
- static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"));
- RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), numberOfFiles));
-
- return result.get();
-}
-
-#if ENABLE(VIDEO)
-String WebCore::mediaElementLoadingStateText() { return String(LPCTSTR_UI_STRING("Loading...", "Media controller status message when the media is loading")); }
-String WebCore::mediaElementLiveBroadcastStateText() { return String(LPCTSTR_UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast")); }
-
-String WebCore::localizedMediaControlElementString(const String& name)
-{
- if (name == "AudioElement")
- return String(LPCTSTR_UI_STRING("audio element controller", "accessibility role description for audio element controller"));
- if (name == "VideoElement")
- return String(LPCTSTR_UI_STRING("video element controller", "accessibility role description for video element controller"));
- if (name == "MuteButton")
- return String(LPCTSTR_UI_STRING("mute", "accessibility role description for mute button"));
- if (name == "UnMuteButton")
- return String(LPCTSTR_UI_STRING("unmute", "accessibility role description for turn mute off button"));
- if (name == "PlayButton")
- return String(LPCTSTR_UI_STRING("play", "accessibility role description for play button"));
- if (name == "PauseButton")
- return String(LPCTSTR_UI_STRING("pause", "accessibility role description for pause button"));
- if (name == "Slider")
- return String(LPCTSTR_UI_STRING("movie time", "accessibility role description for timeline slider"));
- if (name == "SliderThumb")
- return String(LPCTSTR_UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb"));
- if (name == "RewindButton")
- return String(LPCTSTR_UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button"));
- if (name == "ReturnToRealtimeButton")
- return String(LPCTSTR_UI_STRING("return to realtime", "accessibility role description for return to real time button"));
- if (name == "CurrentTimeDisplay")
- return String(LPCTSTR_UI_STRING("elapsed time", "accessibility role description for elapsed time display"));
- if (name == "TimeRemainingDisplay")
- return String(LPCTSTR_UI_STRING("remaining time", "accessibility role description for time remaining display"));
- if (name == "StatusDisplay")
- return String(LPCTSTR_UI_STRING("status", "accessibility role description for movie status"));
- if (name == "FullscreenButton")
- return String(LPCTSTR_UI_STRING("fullscreen", "accessibility role description for enter fullscreen button"));
- if (name == "SeekForwardButton")
- return String(LPCTSTR_UI_STRING("fast forward", "accessibility role description for fast forward button"));
- if (name == "SeekBackButton")
- return String(LPCTSTR_UI_STRING("fast reverse", "accessibility role description for fast reverse button"));
- if (name == "ShowClosedCaptionsButton")
- return String(LPCTSTR_UI_STRING("show closed captions", "accessibility role description for show closed captions button"));
- if (name == "HideClosedCaptionsButton")
- return String(LPCTSTR_UI_STRING("hide closed captions", "accessibility role description for hide closed captions button"));
-
- ASSERT_NOT_REACHED();
- return String();
-}
-
-String WebCore::localizedMediaControlElementHelpText(const String& name)
-{
- if (name == "AudioElement")
- return String(LPCTSTR_UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller"));
- if (name == "VideoElement")
- return String(LPCTSTR_UI_STRING("video element playback controls and status display", "accessibility role description for video element controller"));
- if (name == "MuteButton")
- return String(LPCTSTR_UI_STRING("mute audio tracks", "accessibility help text for mute button"));
- if (name == "UnMuteButton")
- return String(LPCTSTR_UI_STRING("unmute audio tracks", "accessibility help text for un mute button"));
- if (name == "PlayButton")
- return String(LPCTSTR_UI_STRING("begin playback", "accessibility help text for play button"));
- if (name == "PauseButton")
- return String(LPCTSTR_UI_STRING("pause playback", "accessibility help text for pause button"));
- if (name == "Slider")
- return String(LPCTSTR_UI_STRING("movie time scrubber", "accessibility help text for timeline slider"));
- if (name == "SliderThumb")
- return String(LPCTSTR_UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb"));
- if (name == "RewindButton")
- return String(LPCTSTR_UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button"));
- if (name == "ReturnToRealtimeButton")
- return String(LPCTSTR_UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button"));
- if (name == "CurrentTimeDisplay")
- return String(LPCTSTR_UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display"));
- if (name == "TimeRemainingDisplay")
- return String(LPCTSTR_UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display"));
- if (name == "StatusDisplay")
- return String(LPCTSTR_UI_STRING("current movie status", "accessibility help text for movie status display"));
- if (name == "SeekBackButton")
- return String(LPCTSTR_UI_STRING("seek quickly back", "accessibility help text for fast rewind button"));
- if (name == "SeekForwardButton")
- return String(LPCTSTR_UI_STRING("seek quickly forward", "accessibility help text for fast forward button"));
- if (name == "FullscreenButton")
- return String(LPCTSTR_UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button"));
- if (name == "ShowClosedCaptionsButton")
- return String(LPCTSTR_UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button"));
- if (name == "HideClosedCaptionsButton")
- return String(LPCTSTR_UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button"));
-
- ASSERT_NOT_REACHED();
- return String();
-}
-
-String WebCore::localizedMediaTimeDescription(float time)
-{
- if (!isfinite(time))
- return String(LPCTSTR_UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value"));
-
- int seconds = (int)fabsf(time);
- int days = seconds / (60 * 60 * 24);
- int hours = seconds / (60 * 60);
- int minutes = (seconds / 60) % 60;
- seconds %= 60;
-
- if (days) {
- static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"));
- RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), days, hours, minutes, seconds));
- return result.get();
- }
-
- if (hours) {
- static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"));
- RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), hours, minutes, seconds));
- return result.get();
- }
-
- if (minutes) {
- static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"));
- RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), minutes, seconds));
- return result.get();
- }
-
- static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"));
- RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), seconds));
- return result.get();
-}
-
-#endif // ENABLE(VIDEO)
-
-String WebCore::validationMessageValueMissingText() { return String(LPCTSTR_UI_STRING("value missing", "Validation message for required form control elements that have no value")); }
-String WebCore::validationMessageTypeMismatchText() { return String(LPCTSTR_UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type")); }
-String WebCore::validationMessagePatternMismatchText() { return String(LPCTSTR_UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern")); }
-String WebCore::validationMessageTooLongText() { return String(LPCTSTR_UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length")); }
-String WebCore::validationMessageRangeUnderflowText() { return String(LPCTSTR_UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum")); }
-String WebCore::validationMessageRangeOverflowText() { return String(LPCTSTR_UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum")); }
-String WebCore::validationMessageStepMismatchText() { return String(LPCTSTR_UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute")); }
diff --git a/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp b/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
new file mode 100644
index 0000000..00a2eab
--- /dev/null
+++ b/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp
@@ -0,0 +1,611 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebPlatformStrategies.h"
+
+#include "WebLocalizableStrings.h"
+#include <WebCore/IntSize.h>
+#include <WebCore/Page.h>
+#include <WebCore/PageGroup.h>
+#include <WebCore/PluginDatabase.h>
+#include <wtf/MathExtras.h>
+#include <wtf/RetainPtr.h>
+
+using namespace WebCore;
+
+void WebPlatformStrategies::initialize()
+{
+ DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, ());
+}
+
+WebPlatformStrategies::WebPlatformStrategies()
+{
+ setPlatformStrategies(this);
+}
+
+// PluginStrategy
+
+PluginStrategy* WebPlatformStrategies::createPluginStrategy()
+{
+ return this;
+}
+
+LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy()
+{
+ return this;
+}
+
+VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy()
+{
+ return this;
+}
+
+void WebPlatformStrategies::refreshPlugins()
+{
+ PluginDatabase::installedPlugins()->refresh();
+}
+
+void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& outPlugins)
+{
+ const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins();
+
+ outPlugins.resize(plugins.size());
+
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ PluginPackage* package = plugins[i];
+
+ PluginInfo info;
+ info.name = package->name();
+ info.file = package->fileName();
+ info.desc = package->description();
+
+ const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
+
+ info.mimes.reserveCapacity(mimeToDescriptions.size());
+
+ MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
+ for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
+ MimeClassInfo mime;
+
+ mime.type = it->first;
+ mime.desc = it->second;
+ mime.extensions = package->mimeToExtensions().get(mime.type);
+
+ info.mimes.append(mime);
+ }
+
+ outPlugins[i] = info;
+ }
+}
+
+// LocalizationStrategy
+
+String WebPlatformStrategies::searchableIndexIntroduction()
+{
+ return UI_STRING("This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
+}
+
+String WebPlatformStrategies::submitButtonDefaultLabel()
+{
+ return UI_STRING("Submit", "default label for Submit buttons in forms on web pages");
+}
+
+String WebPlatformStrategies::inputElementAltText()
+{
+ return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value");
+}
+
+String WebPlatformStrategies::resetButtonDefaultLabel()
+{
+ return UI_STRING("Reset", "default label for Reset buttons in forms on web pages");
+}
+
+String WebPlatformStrategies::fileButtonChooseFileLabel()
+{
+ return UI_STRING("Choose File", "title for file button used in HTML forms");
+}
+
+String WebPlatformStrategies::fileButtonNoFileSelectedLabel()
+{
+ return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow()
+{
+ return UI_STRING("Open Link in New Window", "Open in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk()
+{
+ return UI_STRING("Download Linked File", "Download Linked File context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard()
+{
+ return UI_STRING("Copy Link", "Copy Link context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow()
+{
+ return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk()
+{
+ return UI_STRING("Download Image", "Download Image context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
+{
+ return UI_STRING("Copy Image", "Copy Image context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
+{
+ return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCopy()
+{
+ return UI_STRING("Copy", "Copy context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagGoBack()
+{
+ return UI_STRING("Back", "Back context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagGoForward()
+{
+ return UI_STRING("Forward", "Forward context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagStop()
+{
+ return UI_STRING("Stop", "Stop context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagReload()
+{
+ return UI_STRING("Reload", "Reload context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCut()
+{
+ return UI_STRING("Cut", "Cut context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagPaste()
+{
+ return UI_STRING("Paste", "Paste context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagNoGuessesFound()
+{
+ return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling()
+{
+ return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagLearnSpelling()
+{
+ return UI_STRING("Learn Spelling", "Learn Spelling context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSearchWeb()
+{
+ return UI_STRING("Search with Google", "Search in Google context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary()
+{
+ return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOpenLink()
+{
+ return UI_STRING("Open Link", "Open Link context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar()
+{
+ return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagSpellingMenu()
+{
+ return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCheckSpelling()
+{
+ return UI_STRING("Check Document Now", "Check spelling context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping()
+{
+ return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling()
+{
+ return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagFontMenu()
+{
+ return UI_STRING("Font", "Font context sub-menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagBold()
+{
+ return UI_STRING("Bold", "Bold context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagItalic()
+{
+ return UI_STRING("Italic", "Italic context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagUnderline()
+{
+ return UI_STRING("Underline", "Underline context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagOutline()
+{
+ return UI_STRING("Outline", "Outline context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu()
+{
+ return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu()
+{
+ return UI_STRING("Selection Direction", "Selection direction context sub-menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagDefaultDirection()
+{
+ return UI_STRING("Default", "Default writing direction context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagLeftToRight()
+{
+ return UI_STRING("Left to Right", "Left to Right context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagRightToLeft()
+{
+ return UI_STRING("Right to Left", "Right to Left context menu item");
+}
+
+String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show)
+{
+ if (show)
+ return UI_STRING("Show Spelling and Grammar", "menu item title");
+ return UI_STRING("Hide Spelling and Grammar", "menu item title");
+}
+
+String WebPlatformStrategies::contextMenuItemTagInspectElement()
+{
+ return UI_STRING("Inspect Element", "Inspect Element context menu item");
+}
+
+String WebPlatformStrategies::searchMenuNoRecentSearchesText()
+{
+ return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed");
+}
+
+String WebPlatformStrategies::searchMenuRecentSearchesText()
+{
+ return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title");
+}
+
+String WebPlatformStrategies::searchMenuClearRecentSearchesText()
+{
+ return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents");
+}
+
+String WebPlatformStrategies::AXWebAreaText()
+{
+ return UI_STRING("web area", "accessibility role description for web area");
+}
+
+String WebPlatformStrategies::AXLinkText()
+{
+ return UI_STRING("link", "accessibility role description for link");
+}
+
+String WebPlatformStrategies::AXListMarkerText()
+{
+ return UI_STRING("list marker", "accessibility role description for list marker");
+}
+
+String WebPlatformStrategies::AXImageMapText()
+{
+ return UI_STRING("image map", "accessibility role description for image map");
+}
+
+String WebPlatformStrategies::AXHeadingText()
+{
+ return UI_STRING("heading", "accessibility role description for headings");
+}
+
+String WebPlatformStrategies::AXDefinitionListTermText()
+{
+ return UI_STRING("term", "term word of a definition");
+}
+
+String WebPlatformStrategies::AXDefinitionListDefinitionText()
+{
+ return UI_STRING("definition", "definition phrase");
+}
+
+String WebPlatformStrategies::AXButtonActionVerb()
+{
+ return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXRadioButtonActionVerb()
+{
+ return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXTextFieldActionVerb()
+{
+ return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXCheckedCheckBoxActionVerb()
+{
+ return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb()
+{
+ return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXLinkActionVerb()
+{
+ return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXMenuListActionVerb()
+{
+ return UI_STRING("open", "Verb stating the action that will occur when a select element is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::AXMenuListPopupActionVerb()
+{
+ return UI_STRING_KEY("press", "press (select element)", "Verb stating the action that will occur when a select element's popup list is clicked, as used by accessibility");
+}
+
+String WebPlatformStrategies::unknownFileSizeText()
+{
+ return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
+}
+
+String WebPlatformStrategies::uploadFileText()
+{
+ return UI_STRING("Upload file", "(Windows) Form submit file upload dialog title");
+}
+
+String WebPlatformStrategies::allFilesText()
+{
+ return UI_STRING("All Files", "(Windows) Form submit file upload all files pop-up");
+}
+
+String WebPlatformStrategies::missingPluginText()
+{
+ return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");
+}
+
+String WebPlatformStrategies::crashedPluginText()
+{
+ return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
+}
+
+String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size)
+{
+ RetainPtr<CFStringRef> filenameCF(AdoptCF, filename.createCFString());
+ return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%@ %d\xC3\x97%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filenameCF.get(), size.width(), size.height())).get();
+}
+
+String WebPlatformStrategies::multipleFileUploadText(unsigned numberOfFiles)
+{
+ return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles)).get();
+}
+
+String WebPlatformStrategies::mediaElementLoadingStateText()
+{
+ return UI_STRING("Loading...", "Media controller status message when the media is loading");
+}
+
+String WebPlatformStrategies::mediaElementLiveBroadcastStateText()
+{
+ return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast");
+}
+
+String WebPlatformStrategies::localizedMediaControlElementString(const String& name)
+{
+ if (name == "AudioElement")
+ return UI_STRING("audio element controller", "accessibility role description for audio element controller");
+ if (name == "VideoElement")
+ return UI_STRING("video element controller", "accessibility role description for video element controller");
+ if (name == "MuteButton")
+ return UI_STRING("mute", "accessibility role description for mute button");
+ if (name == "UnMuteButton")
+ return UI_STRING("unmute", "accessibility role description for turn mute off button");
+ if (name == "PlayButton")
+ return UI_STRING("play", "accessibility role description for play button");
+ if (name == "PauseButton")
+ return UI_STRING("pause", "accessibility role description for pause button");
+ if (name == "Slider")
+ return UI_STRING("movie time", "accessibility role description for timeline slider");
+ if (name == "SliderThumb")
+ return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb");
+ if (name == "RewindButton")
+ return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button");
+ if (name == "ReturnToRealtimeButton")
+ return UI_STRING("return to realtime", "accessibility role description for return to real time button");
+ if (name == "CurrentTimeDisplay")
+ return UI_STRING("elapsed time", "accessibility role description for elapsed time display");
+ if (name == "TimeRemainingDisplay")
+ return UI_STRING("remaining time", "accessibility role description for time remaining display");
+ if (name == "StatusDisplay")
+ return UI_STRING("status", "accessibility role description for movie status");
+ if (name == "FullscreenButton")
+ return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button");
+ if (name == "SeekForwardButton")
+ return UI_STRING("fast forward", "accessibility role description for fast forward button");
+ if (name == "SeekBackButton")
+ return UI_STRING("fast reverse", "accessibility role description for fast reverse button");
+ if (name == "ShowClosedCaptionsButton")
+ return UI_STRING("show closed captions", "accessibility role description for show closed captions button");
+ if (name == "HideClosedCaptionsButton")
+ return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button");
+
+ ASSERT_NOT_REACHED();
+ return String();
+}
+
+String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name)
+{
+ if (name == "AudioElement")
+ return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller");
+ if (name == "VideoElement")
+ return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller");
+ if (name == "MuteButton")
+ return UI_STRING("mute audio tracks", "accessibility help text for mute button");
+ if (name == "UnMuteButton")
+ return UI_STRING("unmute audio tracks", "accessibility help text for un mute button");
+ if (name == "PlayButton")
+ return UI_STRING("begin playback", "accessibility help text for play button");
+ if (name == "PauseButton")
+ return UI_STRING("pause playback", "accessibility help text for pause button");
+ if (name == "Slider")
+ return UI_STRING("movie time scrubber", "accessibility help text for timeline slider");
+ if (name == "SliderThumb")
+ return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb");
+ if (name == "RewindButton")
+ return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button");
+ if (name == "ReturnToRealtimeButton")
+ return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button");
+ if (name == "CurrentTimeDisplay")
+ return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display");
+ if (name == "TimeRemainingDisplay")
+ return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display");
+ if (name == "StatusDisplay")
+ return UI_STRING("current movie status", "accessibility help text for movie status display");
+ if (name == "SeekBackButton")
+ return UI_STRING("seek quickly back", "accessibility help text for fast rewind button");
+ if (name == "SeekForwardButton")
+ return UI_STRING("seek quickly forward", "accessibility help text for fast forward button");
+ if (name == "FullscreenButton")
+ return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button");
+ if (name == "ShowClosedCaptionsButton")
+ return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button");
+ if (name == "HideClosedCaptionsButton")
+ return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
+
+ ASSERT_NOT_REACHED();
+ return String();
+}
+
+String WebPlatformStrategies::localizedMediaTimeDescription(float time)
+{
+ if (!isfinite(time))
+ return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value");
+
+ int seconds = (int)fabsf(time);
+ int days = seconds / (60 * 60 * 24);
+ int hours = seconds / (60 * 60);
+ int minutes = (seconds / 60) % 60;
+ seconds %= 60;
+
+ if (days)
+ return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds)).get();
+
+ if (hours)
+ return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds)).get();
+
+ if (minutes)
+ return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds)).get();
+
+ return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds)).get();
+}
+
+String WebPlatformStrategies::validationMessageValueMissingText()
+{
+ return UI_STRING("value missing", "Validation message for required form control elements that have no value");
+}
+
+String WebPlatformStrategies::validationMessageTypeMismatchText()
+{
+ return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type");
+}
+
+String WebPlatformStrategies::validationMessagePatternMismatchText()
+{
+ return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern");
+}
+
+String WebPlatformStrategies::validationMessageTooLongText()
+{
+ return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length");
+}
+
+String WebPlatformStrategies::validationMessageRangeUnderflowText()
+{
+ return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum");
+}
+
+String WebPlatformStrategies::validationMessageRangeOverflowText()
+{
+ return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum");
+}
+
+String WebPlatformStrategies::validationMessageStepMismatchText()
+{
+ return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute");
+}
+
+bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash)
+{
+ return page->group().isLinkVisited(hash);
+}
+
+void WebPlatformStrategies::addVisitedLink(Page* page, LinkHash hash)
+{
+ page->group().addVisitedLinkHash(hash);
+}
diff --git a/WebKit/win/WebCoreSupport/WebPlatformStrategies.h b/WebKit/win/WebCoreSupport/WebPlatformStrategies.h
new file mode 100644
index 0000000..df19c91
--- /dev/null
+++ b/WebKit/win/WebCoreSupport/WebPlatformStrategies.h
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebPlatformStrategies_h
+#define WebPlatformStrategies_h
+
+#include <WebCore/LocalizationStrategy.h>
+#include <WebCore/PlatformStrategies.h>
+#include <WebCore/PluginStrategy.h>
+#include <WebCore/VisitedLinkStrategy.h>
+
+class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy {
+public:
+ static void initialize();
+
+private:
+ WebPlatformStrategies();
+
+ // WebCore::PlatformStrategies
+ virtual WebCore::PluginStrategy* createPluginStrategy();
+ virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
+ virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
+
+ // WebCore::PluginStrategy
+ virtual void refreshPlugins();
+ virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
+
+ // WebCore::LocalizationStrategy
+ virtual WebCore::String inputElementAltText();
+ virtual WebCore::String resetButtonDefaultLabel();
+ virtual WebCore::String searchableIndexIntroduction();
+ virtual WebCore::String submitButtonDefaultLabel();
+ virtual WebCore::String fileButtonChooseFileLabel();
+ virtual WebCore::String fileButtonNoFileSelectedLabel();
+#if ENABLE(CONTEXT_MENUS)
+ virtual WebCore::String contextMenuItemTagOpenLinkInNewWindow();
+ virtual WebCore::String contextMenuItemTagDownloadLinkToDisk();
+ virtual WebCore::String contextMenuItemTagCopyLinkToClipboard();
+ virtual WebCore::String contextMenuItemTagOpenImageInNewWindow();
+ virtual WebCore::String contextMenuItemTagDownloadImageToDisk();
+ virtual WebCore::String contextMenuItemTagCopyImageToClipboard();
+ virtual WebCore::String contextMenuItemTagOpenFrameInNewWindow();
+ virtual WebCore::String contextMenuItemTagCopy();
+ virtual WebCore::String contextMenuItemTagGoBack();
+ virtual WebCore::String contextMenuItemTagGoForward();
+ virtual WebCore::String contextMenuItemTagStop();
+ virtual WebCore::String contextMenuItemTagReload();
+ virtual WebCore::String contextMenuItemTagCut();
+ virtual WebCore::String contextMenuItemTagPaste();
+ virtual WebCore::String contextMenuItemTagNoGuessesFound();
+ virtual WebCore::String contextMenuItemTagIgnoreSpelling();
+ virtual WebCore::String contextMenuItemTagLearnSpelling();
+ virtual WebCore::String contextMenuItemTagSearchWeb();
+ virtual WebCore::String contextMenuItemTagLookUpInDictionary();
+ virtual WebCore::String contextMenuItemTagOpenLink();
+ virtual WebCore::String contextMenuItemTagIgnoreGrammar();
+ virtual WebCore::String contextMenuItemTagSpellingMenu();
+ virtual WebCore::String contextMenuItemTagShowSpellingPanel(bool show);
+ virtual WebCore::String contextMenuItemTagCheckSpelling();
+ virtual WebCore::String contextMenuItemTagCheckSpellingWhileTyping();
+ virtual WebCore::String contextMenuItemTagCheckGrammarWithSpelling();
+ virtual WebCore::String contextMenuItemTagFontMenu();
+ virtual WebCore::String contextMenuItemTagBold();
+ virtual WebCore::String contextMenuItemTagItalic();
+ virtual WebCore::String contextMenuItemTagUnderline();
+ virtual WebCore::String contextMenuItemTagOutline();
+ virtual WebCore::String contextMenuItemTagWritingDirectionMenu();
+ virtual WebCore::String contextMenuItemTagTextDirectionMenu();
+ virtual WebCore::String contextMenuItemTagDefaultDirection();
+ virtual WebCore::String contextMenuItemTagLeftToRight();
+ virtual WebCore::String contextMenuItemTagRightToLeft();
+ virtual WebCore::String contextMenuItemTagInspectElement();
+#endif // ENABLE(CONTEXT_MENUS)
+ virtual WebCore::String searchMenuNoRecentSearchesText();
+ virtual WebCore::String searchMenuRecentSearchesText();
+ virtual WebCore::String searchMenuClearRecentSearchesText();
+ virtual WebCore::String AXWebAreaText();
+ virtual WebCore::String AXLinkText();
+ virtual WebCore::String AXListMarkerText();
+ virtual WebCore::String AXImageMapText();
+ virtual WebCore::String AXHeadingText();
+ virtual WebCore::String AXDefinitionListTermText();
+ virtual WebCore::String AXDefinitionListDefinitionText();
+ virtual WebCore::String AXButtonActionVerb();
+ virtual WebCore::String AXRadioButtonActionVerb();
+ virtual WebCore::String AXTextFieldActionVerb();
+ virtual WebCore::String AXCheckedCheckBoxActionVerb();
+ virtual WebCore::String AXUncheckedCheckBoxActionVerb();
+ virtual WebCore::String AXMenuListActionVerb();
+ virtual WebCore::String AXMenuListPopupActionVerb();
+ virtual WebCore::String AXLinkActionVerb();
+ virtual WebCore::String missingPluginText();
+ virtual WebCore::String crashedPluginText();
+ virtual WebCore::String multipleFileUploadText(unsigned numberOfFiles);
+ virtual WebCore::String unknownFileSizeText();
+ virtual WebCore::String uploadFileText();
+ virtual WebCore::String allFilesText();
+ virtual WebCore::String imageTitle(const WebCore::String& filename, const WebCore::IntSize&);
+ virtual WebCore::String mediaElementLoadingStateText();
+ virtual WebCore::String mediaElementLiveBroadcastStateText();
+ virtual WebCore::String localizedMediaControlElementString(const WebCore::String&);
+ virtual WebCore::String localizedMediaControlElementHelpText(const WebCore::String&);
+ virtual WebCore::String localizedMediaTimeDescription(float);
+ virtual WebCore::String validationMessageValueMissingText();
+ virtual WebCore::String validationMessageTypeMismatchText();
+ virtual WebCore::String validationMessagePatternMismatchText();
+ virtual WebCore::String validationMessageTooLongText();
+ virtual WebCore::String validationMessageRangeUnderflowText();
+ virtual WebCore::String validationMessageRangeOverflowText();
+ virtual WebCore::String validationMessageStepMismatchText();
+
+ // WebCore::VisitedLinkStrategy
+ virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash);
+ virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
+};
+
+#endif // WebPlatformStrategies_h
diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj
index 50f5921..85e8ee1 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.vcproj
+++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj
@@ -418,10 +418,6 @@
>
</File>
<File
- RelativePath="..\WebCoreLocalizedStrings.cpp"
- >
- </File>
- <File
RelativePath="..\WebKitClassFactory.cpp"
>
</File>
@@ -1328,6 +1324,14 @@
>
</File>
<File
+ RelativePath="..\WebCoreSupport\WebPlatformStrategies.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\WebCoreSupport\WebPlatformStrategies.h"
+ >
+ </File>
+ <File
RelativePath="..\WebCoreSupport\WebPluginHalterClient.cpp"
>
</File>
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index 2e736c2..4fd2b10 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -54,6 +54,7 @@
#include "WebKitSystemBits.h"
#include "WebMutableURLRequest.h"
#include "WebNotificationCenter.h"
+#include "WebPlatformStrategies.h"
#include "WebPluginHalterClient.h"
#include "WebPreferences.h"
#include "WebScriptWorld.h"
@@ -2555,6 +2556,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
WebKitInitializeWebDatabasesIfNecessary();
#endif
WebKitSetApplicationCachePathIfNecessary();
+ WebPlatformStrategies::initialize();
#if USE(SAFARI_THEME)
BOOL shouldPaintNativeControls;
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 35eac71..9ce77e3 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,14 @@
+2010-08-03 Adam Roben <aroben at apple.com>
+
+ Turn on PLATFORM_STRATEGIES on Windows
+
+ Fixes <http://webkit.org/b/43431>.
+
+ Reviewed by Anders Carlsson.
+
+ * win/WebKit2.vcproj: Added WebPlatformStrategies. Also let VS reorder
+ this file as it saw fit.
+
2010-08-03 Balazs Kelemen <kb at inf.u-szeged.hu>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index a724324..3004389 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -592,6 +592,14 @@
>
</File>
<File
+ RelativePath="..\WebProcess\WebCoreSupport\WebPlatformStrategies.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\WebProcess\WebCoreSupport\WebPlatformStrategies.h"
+ >
+ </File>
+ <File
RelativePath="..\WebProcess\WebCoreSupport\WebPopupMenu.cpp"
>
</File>
@@ -730,10 +738,6 @@
>
</File>
<File
- RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundlePrivate.h"
- >
- </File>
- <File
RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleAPICast.h"
>
</File>
@@ -778,6 +782,10 @@
>
</File>
<File
+ RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundlePrivate.h"
+ >
+ </File>
+ <File
RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundleRange.cpp"
>
</File>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list