[Mac] WebKit doesn't enable or disable autocorrections when system preferences are...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2013 01:54:27 +0000 (01:54 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2013 01:54:27 +0000 (01:54 +0000)
commit6f8829512baf47073037d879b965d27525d69725
tree53328e64a7a64952499de1643e5bd6cc89ed6c66
parent31d84dfb9b2692e27fa3345a9c951b8528f7c7ab
[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: https://svn.webkit.org/repository/webkit/trunk@149476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/TextChecker.h
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/UIProcess/mac/TextCheckerMac.mm
Source/WebKit2/UIProcess/mac/WebContextMac.mm