[Mac] WebKit doesn't enable or disable autocorrections when system preferences are changed
https://bugs.webkit.org/show_bug.cgi?id=115463

Reviewed by Darin Adler.

Source/WebKit/mac: 

Observe the default notification center for changes to autocorrection preferences.
Note system preferences may also update WebAutomatic* defaults.

* WebView/WebView.mm:
(+[WebView initialize]):
(+[WebView _shouldAutomaticTextReplacementBeEnabled]):
(+[WebView _didChangeAutomaticTextReplacementEnabled:]):
(+[WebView _shouldAutomaticSpellingCorrectionBeEnabled]):
(+[WebView _didChangeAutomaticSpellingCorrectionEnabled:]):
(+[WebView _shouldAutomaticQuoteSubstitutionBeEnabled]):
(+[WebView _shouldAutomaticDashSubstitutionBeEnabled]):
(+[WebView _didChangeAutomaticQuoteSubstitutionEnabled:]):
(+[WebView _didChangeAutomaticDashSubstitutionEnabled:]):

Source/WebKit2: 

Observe the default notification center and propagate the changes to TextCheckerState and
to all WebProcesses when system preferences are updated.

* UIProcess/TextChecker.h:
* UIProcess/WebContext.h:
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::shouldAutomaticTextReplacementBeEnabled):
(WebKit::shouldAutomaticSpellingCorrectionBeEnabled):
(WebKit::shouldAutomaticQuoteSubstitutionBeEnabled):
(WebKit::shouldAutomaticDashSubstitutionBeEnabled):
(WebKit::initializeState):
(WebKit::TextChecker::didChangeAutomaticTextReplacementEnabled):
(WebKit::TextChecker::didChangeAutomaticSpellingCorrectionEnabled):
(WebKit::TextChecker::didChangeAutomaticQuoteSubstitutionEnabled):
(WebKit::TextChecker::didChangeAutomaticDashSubstitutionEnabled):
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::registerNotificationObservers):
(WebKit::WebContext::unregisterNotificationObservers):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
7 files changed