[GTK] Add API to set preferred languages to WebKit2 GTK+
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Aug 2012 10:27:21 +0000 (10:27 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Aug 2012 10:27:21 +0000 (10:27 +0000)
commita3c7152ff86393951eae4026aa28fbc48426c964
treeeea5fd0ebcf2c12e613609cd45e71ed9ecf92c68
parente6aa861261638609c216c627369307874132be00
[GTK] Add API to set preferred languages to WebKit2 GTK+
https://bugs.webkit.org/show_bug.cgi?id=90878

Source/WebCore:

Unreviewed. Fix mac build.

* WebCore.exp.in: Export WebCore::languageDidChange().

Source/WebKit2:

Reviewed by Martin Robinson.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_set_preferred_languages): Public API to set a
list of preferred languages sorted from most desirable to least
desirable.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
* UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
(testWebContextLanguages):
(serverCallback):
(beforeAll):
(afterAll):
* UIProcess/API/gtk/tests/WebViewTest.cpp:
(resourceGetDataCallback):
(WebViewTest::mainResourceData): Moved from TestWebKitWebContext
to make it available to all WebViewTests.
* UIProcess/API/gtk/tests/WebViewTest.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::userPreferredLanguagesChanged): Notify our
observer that the languages have been overriden.
* WebProcess/gtk/WebProcessGtk.cpp:
(WebKit::buildAcceptLanguages): Helper function to build the
accept languages as specified in RFC 2616.
(WebKit::setSoupSessionAcceptLanguage): Set the accept-language
property of the default SoupSession.
(WebKit::languageChanged): Update the preferred languages in
SoupSession.
(WebKit::WebProcess::platformInitializeWebProcess): Add an
observer to be notified when the list of preferred languages is
updated.
(WebKit::WebProcess::platformTerminate): Remove the observer added
in platformInitializeWebProcess().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebContext.cpp
Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.h
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp