diff options
Diffstat (limited to 'WebKit/win')
36 files changed, 1057 insertions, 378 deletions
diff --git a/WebKit/win/AccessibleBase.h b/WebKit/win/AccessibleBase.h index ca1703f..df2d927 100644 --- a/WebKit/win/AccessibleBase.h +++ b/WebKit/win/AccessibleBase.h @@ -100,8 +100,8 @@ protected: AccessibleBase(WebCore::AccessibilityObject*); virtual ~AccessibleBase(); - virtual WebCore::String name() const; - virtual WebCore::String value() const; + virtual WTF::String name() const; + virtual WTF::String value() const; virtual long role() const; HRESULT getAccessibilityObjectForChild(VARIANT vChild, WebCore::AccessibilityObject*&) const; diff --git a/WebKit/win/AccessibleImage.h b/WebKit/win/AccessibleImage.h index 0c111e2..e987795 100644 --- a/WebKit/win/AccessibleImage.h +++ b/WebKit/win/AccessibleImage.h @@ -35,7 +35,7 @@ public: virtual ~AccessibleImage() { } private: - virtual WebCore::String name() const; + virtual WTF::String name() const; }; #endif // AccessibleImage_h diff --git a/WebKit/win/COMPropertyBag.h b/WebKit/win/COMPropertyBag.h index ae4a7b7..610c367 100644 --- a/WebKit/win/COMPropertyBag.h +++ b/WebKit/win/COMPropertyBag.h @@ -34,7 +34,7 @@ #include "COMVariantSetter.h"
-template<typename ValueType, typename KeyType = typename WebCore::String, typename HashType = typename WebCore::StringHash>
+template<typename ValueType, typename KeyType = typename WTF::String, typename HashType = typename WTF::StringHash>
class COMPropertyBag : public IPropertyBag, public IPropertyBag2, Noncopyable {
public:
typedef HashMap<KeyType, ValueType, HashType> HashMapType;
diff --git a/WebKit/win/COMVariantSetter.h b/WebKit/win/COMVariantSetter.h index 22c20e4..feb233c 100644 --- a/WebKit/win/COMVariantSetter.h +++ b/WebKit/win/COMVariantSetter.h @@ -29,10 +29,7 @@ #include <WebCore/BString.h>
#include <WebCore/COMPtr.h>
#include <wtf/Assertions.h>
-
-namespace WebCore {
- class String;
-}
+#include <wtf/Forward.h>
template<typename T> struct COMVariantSetter {};
@@ -44,11 +41,11 @@ template<typename T> struct COMVariantSetterBase }
};
-template<> struct COMVariantSetter<WebCore::String> : COMVariantSetterBase<WebCore::String>
+template<> struct COMVariantSetter<WTF::String> : COMVariantSetterBase<WTF::String>
{
static const VARENUM VariantType = VT_BSTR;
- static void setVariant(VARIANT* variant, const WebCore::String& value)
+ static void setVariant(VARIANT* variant, const WTF::String& value)
{
ASSERT(V_VT(variant) == VT_EMPTY);
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index d4a850e..acfeab7 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,184 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * COMVariantSetter.h: + * MarshallingHelpers.h: + * WebCoreSupport/WebContextMenuClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebHistory.h: + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * COMVariantSetter.h: + * MarshallingHelpers.h: + * WebCoreSupport/WebContextMenuClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebHistory.h: + +2010-08-05 Jessie Berlin <jberlin@apple.com> + + Reviewed by Jon Honeycutt. + + Bug 43593 - WebView::backingStore should check if m_backingStoreBitmap is NULL. + https://bugs.webkit.org/show_bug.cgi?id=43593 + + * WebView.cpp: + (WebView::backingStore): + If m_backingStoreBitmap is NULL, return E_FAIL. + +2010-08-05 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * COMVariantSetter.h: + * MarshallingHelpers.h: + * WebCoreSupport/WebContextMenuClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebHistory.h: + +2010-08-03 Adam Roben <aroben@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@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=42939 + WebEditorClient::didBeginEditing is never called in WebKit2 + + * WebView.cpp: (WebView::WebViewWndProc): Removed a call to setFocusedFrame. WebCore will + now set it to main frame, and besides, this call should have been before setFocused(), not + after it. My understanding is that we weren't getting all the same editing delegates on Windows, + so this change may make WebKit1 on Windows behave more like Mac - but I haven't tested it. + 2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> Reviewed by Darin Fisher. diff --git a/WebKit/win/DOMCSSClasses.cpp b/WebKit/win/DOMCSSClasses.cpp index c6190ec..b89053b 100644 --- a/WebKit/win/DOMCSSClasses.cpp +++ b/WebKit/win/DOMCSSClasses.cpp @@ -91,7 +91,7 @@ HRESULT STDMETHODCALLTYPE DOMCSSStyleDeclaration::cssText( HRESULT STDMETHODCALLTYPE DOMCSSStyleDeclaration::setCssText( /* [in] */ BSTR cssText) { - WebCore::String cssTextString(cssText); + WTF::String cssTextString(cssText); // FIXME: <rdar://5148045> return DOM exception info WebCore::ExceptionCode ec; m_style->setCssText(cssTextString, ec); @@ -102,8 +102,8 @@ HRESULT STDMETHODCALLTYPE DOMCSSStyleDeclaration::getPropertyValue( /* [in] */ BSTR propertyName, /* [retval][out] */ BSTR* result) { - WebCore::String propertyNameString(propertyName); - WebCore::String value = m_style->getPropertyValue(propertyNameString); + WTF::String propertyNameString(propertyName); + WTF::String value = m_style->getPropertyValue(propertyNameString); *result = SysAllocStringLen(value.characters(), value.length()); if (value.length() && !*result) return E_OUTOFMEMORY; @@ -139,9 +139,9 @@ HRESULT STDMETHODCALLTYPE DOMCSSStyleDeclaration::setProperty( /* [in] */ BSTR value, /* [in] */ BSTR priority) { - WebCore::String propertyNameString(propertyName); - WebCore::String valueString(value); - WebCore::String priorityString(priority); + WTF::String propertyNameString(propertyName); + WTF::String valueString(value); + WTF::String priorityString(priority); // FIXME: <rdar://5148045> return DOM exception info WebCore::ExceptionCode code; m_style->setProperty(propertyNameString, valueString, priorityString, code); diff --git a/WebKit/win/DOMCoreClasses.cpp b/WebKit/win/DOMCoreClasses.cpp index 42e8e63..c6b8823 100644 --- a/WebKit/win/DOMCoreClasses.cpp +++ b/WebKit/win/DOMCoreClasses.cpp @@ -60,14 +60,14 @@ DEFINE_GUID(IID_DOMElement, 0x3b0c0eff, 0x478b, 0x4b0b, 0x82, 0x90, 0xd2, 0x32, // "DOMObject" exists both in the WebCore namespace and unnamespaced in this // file, which leads to ambiguities if we say "using namespace WebCore". using namespace WebCore::HTMLNames; -using WebCore::AtomicString; +using WTF::AtomicString; using WebCore::BString; using WebCore::Element; using WebCore::ExceptionCode; using WebCore::FontDescription; using WebCore::Frame; using WebCore::IntRect; -using WebCore::String; +using WTF::String; // DOMObject - IUnknown ------------------------------------------------------- @@ -119,7 +119,7 @@ HRESULT STDMETHODCALLTYPE DOMNode::nodeValue( { if (!m_node) return E_FAIL; - WebCore::String nodeValueStr = m_node->nodeValue(); + WTF::String nodeValueStr = m_node->nodeValue(); *result = SysAllocStringLen(nodeValueStr.characters(), nodeValueStr.length()); if (nodeValueStr.length() && !*result) return E_OUTOFMEMORY; @@ -894,8 +894,8 @@ HRESULT STDMETHODCALLTYPE DOMElement::getAttribute( { if (!m_element) return E_FAIL; - WebCore::String nameString(name, SysStringLen(name)); - WebCore::String& attrValueString = (WebCore::String&) m_element->getAttribute(nameString); + WTF::String nameString(name, SysStringLen(name)); + WTF::String& attrValueString = (WTF::String&) m_element->getAttribute(nameString); *result = SysAllocStringLen(attrValueString.characters(), attrValueString.length()); if (attrValueString.length() && !*result) return E_OUTOFMEMORY; @@ -909,8 +909,8 @@ HRESULT STDMETHODCALLTYPE DOMElement::setAttribute( if (!m_element) return E_FAIL; - WebCore::String nameString(name, SysStringLen(name)); - WebCore::String valueString(value, SysStringLen(value)); + WTF::String nameString(name, SysStringLen(name)); + WTF::String valueString(value, SysStringLen(value)); WebCore::ExceptionCode ec = 0; m_element->setAttribute(nameString, valueString, ec); return ec ? E_FAIL : S_OK; diff --git a/WebKit/win/DOMHTMLClasses.cpp b/WebKit/win/DOMHTMLClasses.cpp index f9634ff..2dd6deb 100644 --- a/WebKit/win/DOMHTMLClasses.cpp +++ b/WebKit/win/DOMHTMLClasses.cpp @@ -483,7 +483,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLElement::innerText( /* [retval][out] */ BSTR* result) { ASSERT(m_element && m_element->isHTMLElement()); - WebCore::String innerTextString = static_cast<HTMLElement*>(m_element)->innerText(); + WTF::String innerTextString = static_cast<HTMLElement*>(m_element)->innerText(); *result = BString(innerTextString.characters(), innerTextString.length()).release(); return S_OK; } @@ -493,7 +493,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLElement::setInnerText( { ASSERT(m_element && m_element->isHTMLElement()); HTMLElement* htmlEle = static_cast<HTMLElement*>(m_element); - WebCore::String textString(text, SysStringLen(text)); + WTF::String textString(text, SysStringLen(text)); WebCore::ExceptionCode ec = 0; htmlEle->setInnerText(textString, ec); return S_OK; @@ -561,7 +561,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::action( /* [retval][out] */ BSTR* result) { ASSERT(m_element && m_element->hasTagName(formTag)); - WebCore::String actionString = static_cast<HTMLFormElement*>(m_element)->action(); + WTF::String actionString = static_cast<HTMLFormElement*>(m_element)->action(); *result = BString(actionString.characters(), actionString.length()).release(); return S_OK; } @@ -591,7 +591,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::method( /* [retval][out] */ BSTR* result) { ASSERT(m_element && m_element->hasTagName(formTag)); - WebCore::String methodString = static_cast<HTMLFormElement*>(m_element)->method(); + WTF::String methodString = static_cast<HTMLFormElement*>(m_element)->method(); *result = BString(methodString.characters(), methodString.length()).release(); return S_OK; } @@ -1188,7 +1188,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setType( { ASSERT(m_element && m_element->hasTagName(inputTag)); HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); - WebCore::String typeString(type, SysStringLen(type)); + WTF::String typeString(type, SysStringLen(type)); inputElement->setType(typeString); return S_OK; } @@ -1212,7 +1212,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::value( { ASSERT(m_element && m_element->hasTagName(inputTag)); HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); - WebCore::String valueString = inputElement->value(); + WTF::String valueString = inputElement->value(); *result = BString(valueString.characters(), valueString.length()).release(); if (valueString.length() && !*result) return E_OUTOFMEMORY; @@ -1550,7 +1550,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::value( { ASSERT(m_element && m_element->hasTagName(textareaTag)); HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); - WebCore::String valueString = textareaElement->value(); + WTF::String valueString = textareaElement->value(); *result = BString(valueString.characters(), valueString.length()).release(); if (valueString.length() && !*result) return E_OUTOFMEMORY; diff --git a/WebKit/win/MarshallingHelpers.h b/WebKit/win/MarshallingHelpers.h index bbde61f..b213fb9 100644 --- a/WebKit/win/MarshallingHelpers.h +++ b/WebKit/win/MarshallingHelpers.h @@ -26,12 +26,12 @@ #ifndef MarshallingHelpers_H #define MarshallingHelpers_H +#include <wtf/Forward.h> #include <CoreFoundation/CoreFoundation.h> namespace WebCore { class IntRect; class KURL; - class String; } class MarshallingHelpers @@ -39,8 +39,8 @@ class MarshallingHelpers public: static WebCore::KURL BSTRToKURL(BSTR); static BSTR KURLToBSTR(const WebCore::KURL&); - static CFURLRef PathStringToFileCFURLRef(const WebCore::String&); - static WebCore::String FileCFURLRefToPathString(CFURLRef fileURL); + static CFURLRef PathStringToFileCFURLRef(const WTF::String&); + static WTF::String FileCFURLRefToPathString(CFURLRef fileURL); static CFURLRef BSTRToCFURLRef(BSTR); static CFStringRef BSTRToCFStringRef(BSTR); static CFStringRef LPCOLESTRToCFStringRef(LPCOLESTR); 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/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp index 08d4ee9..d5aea25 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp +++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp @@ -786,7 +786,7 @@ void WebChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChoose // FIXME: Show some sort of error if too many files are selected and the buffer is too small. For now, this will fail silently. } -void WebChromeClient::chooseIconForFiles(const Vector<WebCore::String>& filenames, WebCore::FileChooser* chooser) +void WebChromeClient::chooseIconForFiles(const Vector<WTF::String>& filenames, WebCore::FileChooser* chooser) { chooser->iconLoaded(Icon::createIconForFiles(filenames)); } diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h index cea11c7..5a796eb 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.h +++ b/WebKit/win/WebCoreSupport/WebChromeClient.h @@ -78,17 +78,17 @@ public: virtual void setResizable(bool); - virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WebCore::String& message, unsigned line, const WebCore::String& url); + virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WTF::String& message, unsigned line, const WTF::String& url); virtual bool canRunBeforeUnloadConfirmPanel(); - virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame); + virtual bool runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame); virtual void closeWindowSoon(); - virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result); - virtual void setStatusbarText(const WebCore::String&); + virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result); + virtual void setStatusbarText(const WTF::String&); virtual bool shouldInterruptJavaScript(); virtual bool tabsToLinks() const; @@ -109,12 +109,12 @@ public: virtual bool shouldMissingPluginMessageBeButton() const; virtual void missingPluginButtonClicked(WebCore::Element*) const; - virtual void setToolTip(const WebCore::String&, WebCore::TextDirection); + virtual void setToolTip(const WTF::String&, WebCore::TextDirection); virtual void print(WebCore::Frame*); #if ENABLE(DATABASE) - virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String&); + virtual void exceededDatabaseQuota(WebCore::Frame*, const WTF::String&); #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) @@ -130,7 +130,7 @@ public: virtual bool paintCustomScrollCorner(WebCore::GraphicsContext*, const WebCore::FloatRect&); virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); - virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*); + virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); virtual void setCursor(const WebCore::Cursor&); virtual void setLastSetCursorToCurrentCursor(); diff --git a/WebKit/win/WebCoreSupport/WebContextMenuClient.h b/WebKit/win/WebCoreSupport/WebContextMenuClient.h index 153e30e..6bcb072 100644 --- a/WebKit/win/WebCoreSupport/WebContextMenuClient.h +++ b/WebKit/win/WebCoreSupport/WebContextMenuClient.h @@ -26,9 +26,6 @@ #include <WebCore/ContextMenuClient.h> #include <wtf/Forward.h> -namespace WebCore { - class String; -} class WebView; class WebContextMenuClient : public WebCore::ContextMenuClient { @@ -43,7 +40,7 @@ public: virtual void downloadURL(const WebCore::KURL&); virtual void searchWithGoogle(const WebCore::Frame*); virtual void lookUpInDictionary(WebCore::Frame*); - virtual void speak(const WebCore::String&); + virtual void speak(const WTF::String&); virtual void stopSpeaking(); virtual bool isSpeaking(); diff --git a/WebKit/win/WebCoreSupport/WebDragClient.h b/WebKit/win/WebCoreSupport/WebDragClient.h index f7ca139..da2d208 100644 --- a/WebKit/win/WebCoreSupport/WebDragClient.h +++ b/WebKit/win/WebCoreSupport/WebDragClient.h @@ -39,7 +39,7 @@ public: virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&); virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*); virtual void startDrag(WebCore::DragImageRef, const WebCore::IntPoint&, const WebCore::IntPoint&, WebCore::Clipboard*, WebCore::Frame*, bool); - virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String&, WebCore::Frame*); + virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WTF::String&, WebCore::Frame*); private: WebView* m_webView; }; diff --git a/WebKit/win/WebCoreSupport/WebEditorClient.h b/WebKit/win/WebCoreSupport/WebEditorClient.h index ac2e25e..8be6de9 100644 --- a/WebKit/win/WebCoreSupport/WebEditorClient.h +++ b/WebKit/win/WebCoreSupport/WebEditorClient.h @@ -53,7 +53,7 @@ public: virtual bool shouldBeginEditing(WebCore::Range*); virtual bool shouldEndEditing(WebCore::Range*); - virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction); + virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, WebCore::EditorInsertAction); virtual void didBeginEditing(); virtual void didEndEditing(); @@ -98,16 +98,16 @@ public: void handleKeyboardEvent(WebCore::KeyboardEvent*); void handleInputMethodKeydown(WebCore::KeyboardEvent*); - virtual void ignoreWordInSpellDocument(const WebCore::String&); - virtual void learnWord(const WebCore::String&); + virtual void ignoreWordInSpellDocument(const WTF::String&); + virtual void learnWord(const WTF::String&); virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); - virtual WebCore::String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&); + virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&); virtual void checkGrammarOfString(const UChar*, int length, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); - virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail& detail); - virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&); + virtual void updateSpellingUIWithGrammarString(const WTF::String&, const WebCore::GrammarDetail& detail); + virtual void updateSpellingUIWithMisspelledWord(const WTF::String&); virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); - virtual void getGuessesForWord(const WebCore::String&, Vector<WebCore::String>& guesses); + virtual void getGuessesForWord(const WTF::String&, Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool); diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h index 97d9a34..648b5bf 100644 --- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h +++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h @@ -70,7 +70,7 @@ public: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WebCore::String&); + virtual void dispatchDidReceiveTitle(const WTF::String&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFinishDocumentLoad(); @@ -102,7 +102,7 @@ public: virtual void didRunInsecureContent(WebCore::SecurityOrigin*); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WebCore::String& title, const WebCore::KURL&); + virtual void setTitle(const WTF::String& title, const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); @@ -110,13 +110,13 @@ public: virtual bool canCachePage() const; - virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, - const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); + virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, + const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); virtual void didTransferChildFrameToNewDocument(); - virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool loadManually); + virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool loadManually); virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); - virtual bool shouldUsePluginDocument(const WebCore::String& mimeType) const; + virtual bool shouldUsePluginDocument(const WTF::String& mimeType) const; virtual void dispatchDidFailToStartPlugin(const WebCore::PluginView*) const; @@ -125,8 +125,8 @@ protected: ~WebFrameLoaderClient(); private: - PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL&, const WebCore::String& name, WebCore::HTMLFrameOwnerElement*, const WebCore::String& referrer); - void receivedData(const char*, int, const WebCore::String&); + PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement*, const WTF::String& referrer); + void receivedData(const char*, int, const WTF::String&); WebHistory* webHistory() const; WebFrame* m_webFrame; diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h index 17a8d99..4da3984 100644 --- a/WebKit/win/WebCoreSupport/WebInspectorClient.h +++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h @@ -58,10 +58,10 @@ public: virtual void highlight(WebCore::Node*); virtual void hideHighlight(); - virtual void populateSetting(const WebCore::String& key, WebCore::String* value); - virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); + virtual void populateSetting(const WTF::String& key, WTF::String* value); + virtual void storeSetting(const WTF::String& key, const WTF::String& value); - virtual bool sendMessageToFrontend(const WebCore::String&); + virtual bool sendMessageToFrontend(const WTF::String&); void updateHighlight(); void frontendClosing() @@ -88,8 +88,8 @@ public: virtual void frontendLoaded(); - virtual WebCore::String localizedStringsURL(); - virtual WebCore::String hiddenPanels(); + virtual WTF::String localizedStringsURL(); + virtual WTF::String hiddenPanels(); virtual void bringToFront(); virtual void closeWindow(); @@ -98,7 +98,7 @@ public: virtual void detachWindow(); virtual void setAttachedWindowHeight(unsigned height); - virtual void inspectedURLChanged(const WebCore::String& newURL); + virtual void inspectedURLChanged(const WTF::String& newURL); private: ~WebInspectorFrontendClient(); @@ -128,7 +128,7 @@ private: bool m_attached; - WebCore::String m_inspectedURL; + WTF::String m_inspectedURL; bool m_destroyingInspectorView; static friend LRESULT CALLBACK WebInspectorWndProc(HWND, UINT, WPARAM, LPARAM); 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..c3cfbb4 --- /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 WTF::String inputElementAltText(); + virtual WTF::String resetButtonDefaultLabel(); + virtual WTF::String searchableIndexIntroduction(); + virtual WTF::String submitButtonDefaultLabel(); + virtual WTF::String fileButtonChooseFileLabel(); + virtual WTF::String fileButtonNoFileSelectedLabel(); +#if ENABLE(CONTEXT_MENUS) + virtual WTF::String contextMenuItemTagOpenLinkInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadLinkToDisk(); + virtual WTF::String contextMenuItemTagCopyLinkToClipboard(); + virtual WTF::String contextMenuItemTagOpenImageInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadImageToDisk(); + virtual WTF::String contextMenuItemTagCopyImageToClipboard(); + virtual WTF::String contextMenuItemTagOpenFrameInNewWindow(); + virtual WTF::String contextMenuItemTagCopy(); + virtual WTF::String contextMenuItemTagGoBack(); + virtual WTF::String contextMenuItemTagGoForward(); + virtual WTF::String contextMenuItemTagStop(); + virtual WTF::String contextMenuItemTagReload(); + virtual WTF::String contextMenuItemTagCut(); + virtual WTF::String contextMenuItemTagPaste(); + virtual WTF::String contextMenuItemTagNoGuessesFound(); + virtual WTF::String contextMenuItemTagIgnoreSpelling(); + virtual WTF::String contextMenuItemTagLearnSpelling(); + virtual WTF::String contextMenuItemTagSearchWeb(); + virtual WTF::String contextMenuItemTagLookUpInDictionary(); + virtual WTF::String contextMenuItemTagOpenLink(); + virtual WTF::String contextMenuItemTagIgnoreGrammar(); + virtual WTF::String contextMenuItemTagSpellingMenu(); + virtual WTF::String contextMenuItemTagShowSpellingPanel(bool show); + virtual WTF::String contextMenuItemTagCheckSpelling(); + virtual WTF::String contextMenuItemTagCheckSpellingWhileTyping(); + virtual WTF::String contextMenuItemTagCheckGrammarWithSpelling(); + virtual WTF::String contextMenuItemTagFontMenu(); + virtual WTF::String contextMenuItemTagBold(); + virtual WTF::String contextMenuItemTagItalic(); + virtual WTF::String contextMenuItemTagUnderline(); + virtual WTF::String contextMenuItemTagOutline(); + virtual WTF::String contextMenuItemTagWritingDirectionMenu(); + virtual WTF::String contextMenuItemTagTextDirectionMenu(); + virtual WTF::String contextMenuItemTagDefaultDirection(); + virtual WTF::String contextMenuItemTagLeftToRight(); + virtual WTF::String contextMenuItemTagRightToLeft(); + virtual WTF::String contextMenuItemTagInspectElement(); +#endif // ENABLE(CONTEXT_MENUS) + virtual WTF::String searchMenuNoRecentSearchesText(); + virtual WTF::String searchMenuRecentSearchesText(); + virtual WTF::String searchMenuClearRecentSearchesText(); + virtual WTF::String AXWebAreaText(); + virtual WTF::String AXLinkText(); + virtual WTF::String AXListMarkerText(); + virtual WTF::String AXImageMapText(); + virtual WTF::String AXHeadingText(); + virtual WTF::String AXDefinitionListTermText(); + virtual WTF::String AXDefinitionListDefinitionText(); + virtual WTF::String AXButtonActionVerb(); + virtual WTF::String AXRadioButtonActionVerb(); + virtual WTF::String AXTextFieldActionVerb(); + virtual WTF::String AXCheckedCheckBoxActionVerb(); + virtual WTF::String AXUncheckedCheckBoxActionVerb(); + virtual WTF::String AXMenuListActionVerb(); + virtual WTF::String AXMenuListPopupActionVerb(); + virtual WTF::String AXLinkActionVerb(); + virtual WTF::String missingPluginText(); + virtual WTF::String crashedPluginText(); + virtual WTF::String multipleFileUploadText(unsigned numberOfFiles); + virtual WTF::String unknownFileSizeText(); + virtual WTF::String uploadFileText(); + virtual WTF::String allFilesText(); + virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize&); + virtual WTF::String mediaElementLoadingStateText(); + virtual WTF::String mediaElementLiveBroadcastStateText(); + virtual WTF::String localizedMediaControlElementString(const WTF::String&); + virtual WTF::String localizedMediaControlElementHelpText(const WTF::String&); + virtual WTF::String localizedMediaTimeDescription(float); + virtual WTF::String validationMessageValueMissingText(); + virtual WTF::String validationMessageTypeMismatchText(); + virtual WTF::String validationMessagePatternMismatchText(); + virtual WTF::String validationMessageTooLongText(); + virtual WTF::String validationMessageRangeUnderflowText(); + virtual WTF::String validationMessageRangeOverflowText(); + virtual WTF::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/WebCoreSupport/WebPluginHalterClient.h b/WebKit/win/WebCoreSupport/WebPluginHalterClient.h index da3d28a..9a4ca01 100644 --- a/WebKit/win/WebCoreSupport/WebPluginHalterClient.h +++ b/WebKit/win/WebCoreSupport/WebPluginHalterClient.h @@ -27,10 +27,10 @@ #define WebPluginHalterClient_h #include <WebCore/PluginHalterClient.h> +#include <wtf/Forward.h> namespace WebCore { class Node; - class String; } class WebView; @@ -39,7 +39,7 @@ class WebPluginHalterClient : public WebCore::PluginHalterClient { public: WebPluginHalterClient(WebView* webView); - virtual bool shouldHaltPlugin(WebCore::Node* n, bool isWindowed, const WebCore::String& pluginName) const; + virtual bool shouldHaltPlugin(WebCore::Node* n, bool isWindowed, const WTF::String& pluginName) const; virtual bool enabled() const; private: diff --git a/WebKit/win/WebDatabaseManager.cpp b/WebKit/win/WebDatabaseManager.cpp index 238aa61..4c23d6c 100644 --- a/WebKit/win/WebDatabaseManager.cpp +++ b/WebKit/win/WebDatabaseManager.cpp @@ -376,7 +376,7 @@ void WebKitInitializeWebDatabasesIfNecessary() if (initialized) return; - WebCore::String databasesDirectory = WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases"); + WTF::String databasesDirectory = WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases"); WebCore::DatabaseTracker::initializeTracker(databasesDirectory); initialized = true; diff --git a/WebKit/win/WebDatabaseManager.h b/WebKit/win/WebDatabaseManager.h index 405c916..a8ca523 100644 --- a/WebKit/win/WebDatabaseManager.h +++ b/WebKit/win/WebDatabaseManager.h @@ -79,7 +79,7 @@ public: // DatabaseTrackerClient virtual void dispatchDidModifyOrigin(WebCore::SecurityOrigin*); - virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WebCore::String& databaseName); + virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WTF::String& databaseName); private: WebDatabaseManager(); diff --git a/WebKit/win/WebDownload.h b/WebKit/win/WebDownload.h index 71aebfe..bbb645e 100644 --- a/WebKit/win/WebDownload.h +++ b/WebKit/win/WebDownload.h @@ -122,15 +122,15 @@ public: #endif protected: - static CFDataRef extractResumeDataFromBundle(const WebCore::String&); - static HRESULT appendResumeDataToBundle(CFDataRef, const WebCore::String&); - static const WebCore::String& bundleExtension(); + static CFDataRef extractResumeDataFromBundle(const WTF::String&); + static HRESULT appendResumeDataToBundle(CFDataRef, const WTF::String&); + static const WTF::String& bundleExtension(); static UInt32 bundleMagicNumber(); ULONG m_refCount; - WebCore::String m_destination; - WebCore::String m_bundlePath; + WTF::String m_destination; + WTF::String m_bundlePath; #if USE(CFNETWORK) RetainPtr<CFURLDownloadRef> m_download; #endif diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h index c14ddc9..6f8b56a 100644 --- a/WebKit/win/WebFrame.h +++ b/WebKit/win/WebFrame.h @@ -299,9 +299,9 @@ public: virtual void didChangeTitle(WebCore::DocumentLoader*); virtual void didChangeIcons(WebCore::DocumentLoader*); virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; - virtual bool canShowMIMEType(const WebCore::String& MIMEType) const; - virtual bool representationExistsForURLScheme(const WebCore::String& URLScheme) const; - virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String& URLScheme) const; + virtual bool canShowMIMEType(const WTF::String& MIMEType) const; + virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const; + virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const; virtual void frameLoadCompleted(); virtual void restoreViewState(); virtual void provisionalLoadStarted(); @@ -309,7 +309,7 @@ public: virtual void addHistoryItemForFragmentScroll(); virtual void didFinishLoad(); virtual void prepareForDataSourceReplacement(); - virtual WebCore::String userAgent(const WebCore::KURL&); + virtual WTF::String userAgent(const WebCore::KURL&); virtual void saveViewStateToItem(WebCore::HistoryItem *); virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&); virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&); @@ -319,8 +319,8 @@ public: virtual WebCore::ResourceError fileDoesNotExistError(const WebCore::ResourceResponse&); virtual WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&); virtual bool shouldFallBack(const WebCore::ResourceError&); - virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WebCore::String& MIMEType, const WebCore::ResourceRequest&); - virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WebCore::String& frameName); + virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WTF::String& MIMEType, const WebCore::ResourceRequest&); + virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WTF::String& frameName); virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>); virtual void dispatchUnableToImplementPolicy(const WebCore::ResourceError&); virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); @@ -330,10 +330,10 @@ public: virtual void dispatchDidFailLoad(const WebCore::ResourceError&); virtual void startDownload(const WebCore::ResourceRequest&); - virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const Vector<WebCore::String>& paramNames, const Vector<WebCore::String>& paramValues); + virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues); - virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType); - virtual WebCore::String overrideMediaType() const; + virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WTF::String& mimeType); + virtual WTF::String overrideMediaType() const; virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*); virtual void documentElementAvailable(); diff --git a/WebKit/win/WebHistory.h b/WebKit/win/WebHistory.h index 9d8acb3..17cd3a7 100644 --- a/WebKit/win/WebHistory.h +++ b/WebKit/win/WebHistory.h @@ -30,13 +30,13 @@ #include "COMPtr.h" #include <CoreFoundation/CoreFoundation.h> +#include <wtf/Forward.h> #include <wtf/OwnArrayPtr.h> #include <wtf/RetainPtr.h> namespace WebCore { class KURL; class PageGroup; - class String; } //----------------------------------------------------------------------------- @@ -121,10 +121,10 @@ public: // WebHistory static WebHistory* sharedHistory(); - void visitedURL(const WebCore::KURL&, const WebCore::String& title, const WebCore::String& httpMethod, bool wasFailure, bool increaseVisitCount); + void visitedURL(const WebCore::KURL&, const WTF::String& title, const WTF::String& httpMethod, bool wasFailure, bool increaseVisitCount); void addVisitedLinksToPageGroup(WebCore::PageGroup&); - COMPtr<IWebHistoryItem> itemForURLString(const WebCore::String&) const; + COMPtr<IWebHistoryItem> itemForURLString(const WTF::String&) const; typedef int64_t DateKey; typedef HashMap<DateKey, RetainPtr<CFMutableArrayRef> > DateToEntriesMap; diff --git a/WebKit/win/WebHistoryItem.h b/WebKit/win/WebHistoryItem.h index 40ec16d..7e42039 100644 --- a/WebKit/win/WebHistoryItem.h +++ b/WebKit/win/WebHistoryItem.h @@ -113,7 +113,7 @@ protected: ULONG m_refCount; RefPtr<WebCore::HistoryItem> m_historyItem; - WebCore::String m_alternateTitle; + WTF::String m_alternateTitle; }; #endif diff --git a/WebKit/win/WebIconDatabase.h b/WebKit/win/WebIconDatabase.h index ac42d4a..c6351a7 100644 --- a/WebKit/win/WebIconDatabase.h +++ b/WebKit/win/WebIconDatabase.h @@ -104,7 +104,7 @@ public: // IconDatabaseClient virtual void dispatchDidRemoveAllIcons(); - virtual void dispatchDidAddIconForPageURL(const WebCore::String&); + virtual void dispatchDidAddIconForPageURL(const WTF::String&); static BSTR iconDatabaseDidAddIconNotification(); static BSTR iconDatabaseDidRemoveAllIconsNotification(); 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/WebKitDLL.h b/WebKit/win/WebKitDLL.h index d944b07..c31bc2d 100644 --- a/WebKit/win/WebKitDLL.h +++ b/WebKit/win/WebKitDLL.h @@ -48,7 +48,7 @@ extern "C" { extern ULONG gLockCount; extern ULONG gClassCount; -extern HashCountedSet<WebCore::String> gClassNameCount; +extern HashCountedSet<WTF::String> gClassNameCount; extern HINSTANCE gInstance; extern CLSID gRegCLSIDs[]; diff --git a/WebKit/win/WebKitSystemBits.cpp b/WebKit/win/WebKitSystemBits.cpp index e8ee0e9..eec6361 100644 --- a/WebKit/win/WebKitSystemBits.cpp +++ b/WebKit/win/WebKitSystemBits.cpp @@ -46,7 +46,7 @@ unsigned long long WebMemorySize() unsigned long long WebVolumeFreeSize(CFStringRef cfstringPath) { - WebCore::String path(cfstringPath); + WTF::String path(cfstringPath); ULARGE_INTEGER freeBytesToCaller; BOOL result = GetDiskFreeSpaceExW((LPCWSTR)path.charactersWithNullTermination(), &freeBytesToCaller, 0, 0); if (!result) diff --git a/WebKit/win/WebNavigationData.h b/WebKit/win/WebNavigationData.h index d00912c..f4793dc 100644 --- a/WebKit/win/WebNavigationData.h +++ b/WebKit/win/WebNavigationData.h @@ -33,9 +33,9 @@ class WebNavigationData : public IWebNavigationData { public: - static WebNavigationData* createInstance(const WebCore::String& url, const WebCore::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WebCore::String& clientRedirectSource); + static WebNavigationData* createInstance(const WTF::String& url, const WTF::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WTF::String& clientRedirectSource); private: - WebNavigationData(const WebCore::String& url, const WebCore::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WebCore::String& clientRedirectSource); + WebNavigationData(const WTF::String& url, const WTF::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WTF::String& clientRedirectSource); ~WebNavigationData(); public: diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp index a1055cb..25cfbda 100644 --- a/WebKit/win/WebPreferences.cpp +++ b/WebKit/win/WebPreferences.cpp @@ -102,7 +102,7 @@ static bool booleanValueForPreferencesValue(CFPropertyListRef value) static CFDictionaryRef defaultSettings; -static HashMap<WebCore::String, COMPtr<WebPreferences> > webPreferencesInstances; +static HashMap<WTF::String, COMPtr<WebPreferences> > webPreferencesInstances; WebPreferences* WebPreferences::sharedStandardPreferences() { @@ -154,7 +154,7 @@ WebPreferences* WebPreferences::getInstanceForIdentifier(BSTR identifier) if (!identifier) return sharedStandardPreferences(); - WebCore::String identifierString(identifier, SysStringLen(identifier)); + WTF::String identifierString(identifier, SysStringLen(identifier)); return webPreferencesInstances.get(identifierString).get(); } @@ -162,7 +162,7 @@ void WebPreferences::setInstance(WebPreferences* instance, BSTR identifier) { if (!identifier || !instance) return; - WebCore::String identifierString(identifier, SysStringLen(identifier)); + WTF::String identifierString(identifier, SysStringLen(identifier)); webPreferencesInstances.add(identifierString, instance); } @@ -171,7 +171,7 @@ void WebPreferences::removeReferenceForIdentifier(BSTR identifier) if (!identifier || webPreferencesInstances.isEmpty()) return; - WebCore::String identifierString(identifier, SysStringLen(identifier)); + WTF::String identifierString(identifier, SysStringLen(identifier)); WebPreferences* webPreference = webPreferencesInstances.get(identifierString).get(); if (webPreference && webPreference->m_refCount == 1) webPreferencesInstances.remove(identifierString); @@ -194,7 +194,7 @@ void WebPreferences::initializeDefaultSettings() CFDictionaryAddValue(defaults, CFSTR(WebKitMinimumLogicalFontSizePreferenceKey), CFSTR("9")); CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultFontSizePreferenceKey), CFSTR("16")); CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultFixedFontSizePreferenceKey), CFSTR("13")); - WebCore::String defaultDefaultEncoding(LPCTSTR_UI_STRING("ISO-8859-1", "The default, default character encoding")); + WTF::String defaultDefaultEncoding(LPCTSTR_UI_STRING("ISO-8859-1", "The default, default character encoding")); CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultTextEncodingNamePreferenceKey), defaultDefaultEncoding.createCFString()); CFDictionaryAddValue(defaults, CFSTR(WebKitUserStyleSheetEnabledPreferenceKey), kCFBooleanFalse); diff --git a/WebKit/win/WebResource.cpp b/WebKit/win/WebResource.cpp index d02bcc5..506e55d 100644 --- a/WebKit/win/WebResource.cpp +++ b/WebKit/win/WebResource.cpp @@ -38,7 +38,7 @@ using namespace WebCore; // WebResource --------------------------------------------------------------------- -WebResource::WebResource(IStream* data, const WebCore::KURL& url, const WebCore::String& mimeType, const WebCore::String& textEncodingName, const WebCore::String& frameName) +WebResource::WebResource(IStream* data, const WebCore::KURL& url, const WTF::String& mimeType, const WTF::String& textEncodingName, const WTF::String& frameName) : m_refCount(0) , m_data(data) , m_url(url) diff --git a/WebKit/win/WebResource.h b/WebKit/win/WebResource.h index d67cb56..7c6759a 100644 --- a/WebKit/win/WebResource.h +++ b/WebKit/win/WebResource.h @@ -41,7 +41,7 @@ class WebResource : public IWebResource { public: static WebResource* createInstance(PassRefPtr<WebCore::SharedBuffer> data, const WebCore::ResourceResponse& response); protected: - WebResource(IStream* data, const WebCore::KURL& url, const WebCore::String& mimeType, const WebCore::String& textEncodingName, const WebCore::String& frameName); + WebResource(IStream* data, const WebCore::KURL& url, const WTF::String& mimeType, const WTF::String& textEncodingName, const WTF::String& frameName); ~WebResource(); public: @@ -77,9 +77,9 @@ private: ULONG m_refCount; COMPtr<IStream> m_data; WebCore::KURL m_url; - WebCore::String m_mimeType; - WebCore::String m_textEncodingName; - WebCore::String m_frameName; + WTF::String m_mimeType; + WTF::String m_textEncodingName; + WTF::String m_frameName; }; #endif diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index 8dfb7e7..c307c02 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" @@ -2111,10 +2112,8 @@ LRESULT CALLBACK WebView::WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, // child of ours (for example a plugin). if (!IsChild(hWnd, reinterpret_cast<HWND>(wParam))) focusController->setFocused(true); - } else { + } else focusController->setFocused(true); - focusController->setFocusedFrame(webView->page()->mainFrame()); - } break; } case WM_KILLFOCUS: { @@ -2557,6 +2556,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame( WebKitInitializeWebDatabasesIfNecessary(); #endif WebKitSetApplicationCachePathIfNecessary(); + WebPlatformStrategies::initialize(); #if USE(SAFARI_THEME) BOOL shouldPaintNativeControls; @@ -3089,7 +3089,7 @@ HRESULT STDMETHODCALLTYPE WebView::stringByEvaluatingJavaScriptFromString( if (!coreFrame) return E_FAIL; - JSC::JSValue scriptExecutionResult = coreFrame->script()->executeScript(WebCore::String(script), true).jsValue(); + JSC::JSValue scriptExecutionResult = coreFrame->script()->executeScript(WTF::String(script), true).jsValue(); if (!scriptExecutionResult) return E_FAIL; else if (scriptExecutionResult.isString()) { @@ -5725,6 +5725,8 @@ HRESULT STDMETHODCALLTYPE WebView::backingStore( { if (!hBitmap) return E_POINTER; + if (!m_backingStoreBitmap) + return E_FAIL; *hBitmap = reinterpret_cast<OLE_HANDLE>(m_backingStoreBitmap->handle()); return S_OK; } @@ -5856,7 +5858,7 @@ HRESULT STDMETHODCALLTYPE WebView::registerEmbeddedViewMIMEType(BSTR mimeType) return S_OK; } -bool WebView::shouldUseEmbeddedView(const WebCore::String& mimeType) const +bool WebView::shouldUseEmbeddedView(const WTF::String& mimeType) const { if (!m_embeddedViewMIMETypes) return false; diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h index c7e7605..eec24fd 100644 --- a/WebKit/win/WebView.h +++ b/WebKit/win/WebView.h @@ -806,7 +806,7 @@ public: virtual HRESULT STDMETHODCALLTYPE nextDisplayIsSynchronous(); // WebView - bool shouldUseEmbeddedView(const WebCore::String& mimeType) const; + bool shouldUseEmbeddedView(const WTF::String& mimeType) const; WebCore::Page* page(); bool handleMouseEvent(UINT, WPARAM, LPARAM); @@ -859,11 +859,11 @@ public: // Convenient to be able to violate the rules of COM here for easy movement to the frame. WebFrame* topLevelFrame() const { return m_mainFrame; } - const WebCore::String& userAgentForKURL(const WebCore::KURL& url); + const WTF::String& userAgentForKURL(const WebCore::KURL& url); static bool canHandleRequest(const WebCore::ResourceRequest&); - static WebCore::String standardUserAgentWithApplicationName(const WebCore::String&); + static WTF::String standardUserAgentWithApplicationName(const WTF::String&); void setIsBeingDestroyed() { m_isBeingDestroyed = true; } bool isBeingDestroyed() const { return m_isBeingDestroyed; } @@ -873,7 +873,7 @@ public: bool isPainting() const { return m_paintCount > 0; } - void setToolTip(const WebCore::String&); + void setToolTip(const WTF::String&); void registerForIconNotification(bool listen); void dispatchDidReceiveIconFromWebFrame(WebFrame*); @@ -992,11 +992,11 @@ protected: bool m_userAgentOverridden; bool m_useBackForwardList; - WebCore::String m_userAgentCustom; - WebCore::String m_userAgentStandard; + WTF::String m_userAgentCustom; + WTF::String m_userAgentStandard; float m_zoomMultiplier; - WebCore::String m_overrideEncoding; - WebCore::String m_applicationName; + WTF::String m_overrideEncoding; + WTF::String m_applicationName; bool m_mouseActivated; // WebCore dragging logic needs to be able to inspect the drag data // this is updated in DragEnter/Leave/Drop @@ -1012,7 +1012,7 @@ protected: bool m_hasCustomDropTarget; unsigned m_inIMEComposition; HWND m_toolTipHwnd; - WebCore::String m_toolTip; + WTF::String m_toolTip; bool m_deleteBackingStoreTimerActive; bool m_transparent; @@ -1024,7 +1024,7 @@ protected: HWND m_topLevelParent; - OwnPtr<HashSet<WebCore::String> > m_embeddedViewMIMETypes; + OwnPtr<HashSet<WTF::String> > m_embeddedViewMIMETypes; //Variables needed to store gesture information RefPtr<WebCore::Node> m_gestureTargetNode; |