Add default localization strategy that can be shared by WebKit1 and WebKit2
https://bugs.webkit.org/show_bug.cgi?id=57406
Reviewed by Anders Carlsson.
Source/WebCore:
Currently, only WebKit2 uses this default strategy, but WebKit1 should be able
to adopt it soon.
* platform/DefaultLocalizationStrategy.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp.
(WebCore::DefaultLocalizationStrategy::DefaultLocalizationStrategy):
* platform/DefaultLocalizationStrategy.h: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h.
Copy the implementation of the Localization strategy from WebKit2 into a shared default strategy.
* platform/LocalizedStrings.cpp:
(WebCore::localizedString):
Add default implementation of localization bottleneck function.
* platform/LocalizedStrings.h:
Add localization macros here, instead of defining them in the above layer.
* platform/PlatformStrategies.cpp:
(WebCore::PlatformStrategies::createLocalizationStrategy):
* platform/PlatformStrategies.h:
Add default implementation of strategy creation function which creates the default strategy.
* platform/win/LocalizedStringsWin.cpp: Copied from Source/WebCore/platform/mac/LocalizedStringsMac.mm.
(WebCore::localizedString):
Add stub for windows, this will be update to pull from the bundle in a follow up patch.
* Android.mk:
* CMakeLists.txt:
* GNUmakefile.am:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Add new files.
Source/WebKit2:
* Shared/WebLocalizableStrings.h: Removed.
Removed in favor of using WebCore/LocalizedStrings.h directly.
* PluginProcess/mac/PluginProcessMac.mm:
* UIProcess/API/mac/WKView.mm:
* UIProcess/mac/WebInspectorProxyMac.mm:
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
* WebProcess/mac/WebProcessMac.mm:
Use WebCore/LocalizedStrings.h directly.
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
Remove localization strategy override in favor of using new default implementation.
* GNUmakefile.am:
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:
Remove WebLocalizableStrings.h
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/platform/PlatformStrategies.cpp b/Source/WebCore/platform/PlatformStrategies.cpp
index e0baa70..9623108 100644
--- a/Source/WebCore/platform/PlatformStrategies.cpp
+++ b/Source/WebCore/platform/PlatformStrategies.cpp
@@ -29,6 +29,8 @@
#include "PlatformStrategies.h"
+#include "DefaultLocalizationStrategy.h"
+
namespace WebCore {
static PlatformStrategies* s_platformStrategies;
@@ -51,7 +53,12 @@
// throw an exception here in release builds.
ASSERT(platformStrategies != s_platformStrategies);
}
-
+
+LocalizationStrategy* PlatformStrategies::createLocalizationStrategy()
+{
+ return new DefaultLocalizationStrategy;
+}
+
} // namespace WebCore
#endif // USE(PLATFORM_STRATEGIES)