Title: [149476] trunk/Source
- Revision
- 149476
- Author
- [email protected]
- Date
- 2013-05-01 18:54:27 -0700 (Wed, 01 May 2013)
Log Message
[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):
Modified Paths
Diff
Modified: trunk/Source/WebKit/mac/ChangeLog (149475 => 149476)
--- trunk/Source/WebKit/mac/ChangeLog 2013-05-02 01:53:45 UTC (rev 149475)
+++ trunk/Source/WebKit/mac/ChangeLog 2013-05-02 01:54:27 UTC (rev 149476)
@@ -1,3 +1,24 @@
+2011-05-01 Ryosuke Niwa <[email protected]>
+
+ [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.
+
+ 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:]):
+
2013-05-01 Benjamin Poulain <[email protected]>
Fix the function names of r149453
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (149475 => 149476)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2013-05-02 01:53:45 UTC (rev 149475)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2013-05-02 01:54:27 UTC (rev 149476)
@@ -3136,7 +3136,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillTerminate) name:NSApplicationWillTerminateNotification object:NSApp];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_cacheModelChangedNotification:) name:WebPreferencesCacheModelChangedInternalNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesRemovedNotification:) name:WebPreferencesRemovedNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesRemovedNotification:) name:WebPreferencesRemovedNotification object:nil];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -3149,20 +3149,87 @@
Font::setDefaultTypesettingFeatures([defaults boolForKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey] ? Kerning | Ligatures : 0);
- automaticQuoteSubstitutionEnabled = [defaults boolForKey:WebAutomaticQuoteSubstitutionEnabled];
+ automaticQuoteSubstitutionEnabled = [self _shouldAutomaticQuoteSubstitutionBeEnabled];
automaticLinkDetectionEnabled = [defaults boolForKey:WebAutomaticLinkDetectionEnabled];
- automaticDashSubstitutionEnabled = [defaults boolForKey:WebAutomaticDashSubstitutionEnabled];
- automaticTextReplacementEnabled = [defaults boolForKey:WebAutomaticTextReplacementEnabled];
- automaticSpellingCorrectionEnabled = [defaults boolForKey:WebAutomaticSpellingCorrectionEnabled];
+ automaticDashSubstitutionEnabled = [self _shouldAutomaticDashSubstitutionBeEnabled];
+ automaticTextReplacementEnabled = [self _shouldAutomaticTextReplacementBeEnabled];
+ automaticSpellingCorrectionEnabled = [self _shouldAutomaticSpellingCorrectionBeEnabled];
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didChangeAutomaticTextReplacementEnabled:)
+ name:NSSpellCheckerDidChangeAutomaticTextReplacementNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didChangeAutomaticSpellingCorrectionEnabled:)
+ name:NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification object:nil];
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didChangeAutomaticQuoteSubstitutionEnabled:)
+ name:NSSpellCheckerDidChangeAutomaticQuoteSubstitutionNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didChangeAutomaticDashSubstitutionEnabled:)
+ name:NSSpellCheckerDidChangeAutomaticDashSubstitutionNotification object:nil];
+#endif
+}
+
++ (BOOL)_shouldAutomaticTextReplacementBeEnabled
+{
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults objectForKey:WebAutomaticTextReplacementEnabled])
- automaticTextReplacementEnabled = [NSSpellChecker isAutomaticTextReplacementEnabled];
+ return [NSSpellChecker isAutomaticTextReplacementEnabled];
+ return [defaults boolForKey:WebAutomaticTextReplacementEnabled];
+}
+
++ (void)_didChangeAutomaticTextReplacementEnabled:(NSNotification *)notification
+{
+ automaticTextReplacementEnabled = [self _shouldAutomaticTextReplacementBeEnabled];
+ [[NSSpellChecker sharedSpellChecker] updatePanels];
+}
+
++ (BOOL)_shouldAutomaticSpellingCorrectionBeEnabled
+{
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (![defaults objectForKey:WebAutomaticSpellingCorrectionEnabled])
- automaticSpellingCorrectionEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
+ return [NSSpellChecker isAutomaticTextReplacementEnabled];
+ return [defaults boolForKey:WebAutomaticSpellingCorrectionEnabled];
+}
+
++ (void)_didChangeAutomaticSpellingCorrectionEnabled:(NSNotification *)notification
+{
+ automaticSpellingCorrectionEnabled = [self _shouldAutomaticSpellingCorrectionBeEnabled];
+ [[NSSpellChecker sharedSpellChecker] updatePanels];
+}
+
++ (BOOL)_shouldAutomaticQuoteSubstitutionBeEnabled
+{
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ if (![defaults objectForKey:WebAutomaticQuoteSubstitutionEnabled])
+ return [NSSpellChecker isAutomaticQuoteSubstitutionEnabled];
#endif
+ return [defaults boolForKey:WebAutomaticQuoteSubstitutionEnabled];
}
++ (BOOL)_shouldAutomaticDashSubstitutionBeEnabled
+{
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ if (![defaults objectForKey:WebAutomaticDashSubstitutionEnabled])
+ return [NSSpellChecker isAutomaticDashSubstitutionEnabled];
+#endif
+ return [defaults boolForKey:WebAutomaticDashSubstitutionEnabled];
+}
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
++ (void)_didChangeAutomaticQuoteSubstitutionEnabled:(NSNotification *)notification
+{
+ automaticQuoteSubstitutionEnabled = [self _shouldAutomaticQuoteSubstitutionBeEnabled];
+ [[NSSpellChecker sharedSpellChecker] updatePanels];
+}
+
++ (void)_didChangeAutomaticDashSubstitutionEnabled:(NSNotification *)notification
+{
+ automaticDashSubstitutionEnabled = [self _shouldAutomaticDashSubstitutionBeEnabled];
+ [[NSSpellChecker sharedSpellChecker] updatePanels];
+}
+#endif
+
+ (void)_applicationWillTerminate
{
applicationIsTerminating = YES;
Modified: trunk/Source/WebKit2/ChangeLog (149475 => 149476)
--- trunk/Source/WebKit2/ChangeLog 2013-05-02 01:53:45 UTC (rev 149475)
+++ trunk/Source/WebKit2/ChangeLog 2013-05-02 01:54:27 UTC (rev 149476)
@@ -1,3 +1,29 @@
+2013-05-01 Ryosuke Niwa <[email protected]>
+
+ [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.
+
+ 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):
+
2013-05-01 Ryuan Choi <[email protected]>
[GTK] Fix build break after r149449
Modified: trunk/Source/WebKit2/UIProcess/TextChecker.h (149475 => 149476)
--- trunk/Source/WebKit2/UIProcess/TextChecker.h 2013-05-02 01:53:45 UTC (rev 149475)
+++ trunk/Source/WebKit2/UIProcess/TextChecker.h 2013-05-02 01:54:27 UTC (rev 149476)
@@ -50,6 +50,11 @@
static void setAutomaticLinkDetectionEnabled(bool);
static void setAutomaticTextReplacementEnabled(bool);
+ static void didChangeAutomaticTextReplacementEnabled();
+ static void didChangeAutomaticSpellingCorrectionEnabled();
+ static void didChangeAutomaticQuoteSubstitutionEnabled();
+ static void didChangeAutomaticDashSubstitutionEnabled();
+
static bool isSmartInsertDeleteEnabled();
static void setSmartInsertDeleteEnabled(bool);
Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (149475 => 149476)
--- trunk/Source/WebKit2/UIProcess/WebContext.h 2013-05-02 01:53:45 UTC (rev 149475)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h 2013-05-02 01:54:27 UTC (rev 149476)
@@ -59,6 +59,7 @@
#endif
#if PLATFORM(MAC)
+OBJC_CLASS NSObject;
OBJC_CLASS NSString;
#endif
@@ -454,10 +455,17 @@
#endif
#if PLATFORM(MAC)
- RetainPtr<CFTypeRef> m_enhancedAccessibilityObserver;
- RetainPtr<CFTypeRef> m_customSchemeRegisteredObserver;
- RetainPtr<CFTypeRef> m_customSchemeUnregisteredObserver;
+ RetainPtr<NSObject> m_enhancedAccessibilityObserver;
+ RetainPtr<NSObject> m_customSchemeRegisteredObserver;
+ RetainPtr<NSObject> m_customSchemeUnregisteredObserver;
+
+ RetainPtr<NSObject> m_automaticTextReplacementNotificationObserver;
+ RetainPtr<NSObject> m_automaticSpellingCorrectionNotificationObserver;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ RetainPtr<NSObject> m_automaticQuoteSubstitutionNotificationObserver;
+ RetainPtr<NSObject> m_automaticDashSubstitutionNotificationObserver;
#endif
+#endif
String m_overrideDatabaseDirectory;
String m_overrideIconDatabasePath;
Modified: trunk/Source/WebKit2/UIProcess/mac/TextCheckerMac.mm (149475 => 149476)
--- trunk/Source/WebKit2/UIProcess/mac/TextCheckerMac.mm 2013-05-02 01:53:45 UTC (rev 149475)
+++ trunk/Source/WebKit2/UIProcess/mac/TextCheckerMac.mm 2013-05-02 01:54:27 UTC (rev 149476)
@@ -49,23 +49,57 @@
TextCheckerState textCheckerState;
+static bool shouldAutomaticTextReplacementBeEnabled()
+{
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ if (![defaults objectForKey:WebAutomaticTextReplacementEnabled])
+ return [NSSpellChecker isAutomaticTextReplacementEnabled];
+ return [defaults boolForKey:WebAutomaticTextReplacementEnabled];
+}
+
+static bool shouldAutomaticSpellingCorrectionBeEnabled()
+{
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ if (![defaults objectForKey:WebAutomaticSpellingCorrectionEnabled])
+ return [NSSpellChecker isAutomaticTextReplacementEnabled];
+ return [defaults boolForKey:WebAutomaticSpellingCorrectionEnabled];
+}
+
+static bool shouldAutomaticQuoteSubstitutionBeEnabled()
+{
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ if (![defaults objectForKey:WebAutomaticQuoteSubstitutionEnabled])
+ return [NSSpellChecker isAutomaticQuoteSubstitutionEnabled];
+#endif
+ return [defaults boolForKey:WebAutomaticQuoteSubstitutionEnabled];
+}
+
+static bool shouldAutomaticDashSubstitutionBeEnabled()
+{
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ if (![defaults objectForKey:WebAutomaticDashSubstitutionEnabled])
+ return [NSSpellChecker isAutomaticDashSubstitutionEnabled];
+#endif
+ return [defaults boolForKey:WebAutomaticDashSubstitutionEnabled];
+}
+
static void initializeState()
{
- static bool didInitializeState;
+ static bool didInitializeState = false;
+
if (didInitializeState)
return;
textCheckerState.isContinuousSpellCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled] && TextChecker::isContinuousSpellCheckingAllowed();
textCheckerState.isGrammarCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebGrammarCheckingEnabled];
- textCheckerState.isAutomaticSpellingCorrectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticSpellingCorrectionEnabled];
- textCheckerState.isAutomaticQuoteSubstitutionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticQuoteSubstitutionEnabled];
- textCheckerState.isAutomaticDashSubstitutionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticDashSubstitutionEnabled];
+ textCheckerState.isAutomaticTextReplacementEnabled = shouldAutomaticTextReplacementBeEnabled();
+ textCheckerState.isAutomaticSpellingCorrectionEnabled = shouldAutomaticSpellingCorrectionBeEnabled();
+ textCheckerState.isAutomaticQuoteSubstitutionEnabled = shouldAutomaticQuoteSubstitutionBeEnabled();
+ textCheckerState.isAutomaticDashSubstitutionEnabled = shouldAutomaticDashSubstitutionBeEnabled();
textCheckerState.isAutomaticLinkDetectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticLinkDetectionEnabled];
- textCheckerState.isAutomaticTextReplacementEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticTextReplacementEnabled];
- if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticSpellingCorrectionEnabled])
- textCheckerState.isAutomaticSpellingCorrectionEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
-
didInitializeState = true;
}
@@ -194,6 +228,34 @@
[[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebSmartInsertDeleteEnabled];
}
+void TextChecker::didChangeAutomaticTextReplacementEnabled()
+{
+ textCheckerState.isAutomaticTextReplacementEnabled = shouldAutomaticTextReplacementBeEnabled();
+ [[NSSpellChecker sharedSpellChecker] updatePanels];
+}
+
+void TextChecker::didChangeAutomaticSpellingCorrectionEnabled()
+{
+ textCheckerState.isAutomaticSpellingCorrectionEnabled = shouldAutomaticSpellingCorrectionBeEnabled();
+ [[NSSpellChecker sharedSpellChecker] updatePanels];
+}
+
+void TextChecker::didChangeAutomaticQuoteSubstitutionEnabled()
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ textCheckerState.isAutomaticQuoteSubstitutionEnabled = shouldAutomaticQuoteSubstitutionBeEnabled();
+ [[NSSpellChecker sharedSpellChecker] updatePanels];
+#endif
+}
+
+void TextChecker::didChangeAutomaticDashSubstitutionEnabled()
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ textCheckerState.isAutomaticDashSubstitutionEnabled = shouldAutomaticDashSubstitutionBeEnabled();
+ [[NSSpellChecker sharedSpellChecker] updatePanels];
+#endif
+}
+
bool TextChecker::substitutionsPanelIsShowing()
{
return [[[NSSpellChecker sharedSpellChecker] substitutionsPanel] isVisible];
Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm (149475 => 149476)
--- trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm 2013-05-02 01:53:45 UTC (rev 149475)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm 2013-05-02 01:54:27 UTC (rev 149476)
@@ -28,6 +28,7 @@
#import "PluginProcessManager.h"
#import "SharedWorkerProcessManager.h"
+#import "TextChecker.h"
#import "WKBrowsingContextControllerInternal.h"
#import "WKBrowsingContextControllerInternal.h"
#import "WebKitSystemInterface.h"
@@ -510,24 +511,53 @@
ASSERT([scheme isKindOfClass:[NSString class]]);
registerSchemeForCustomProtocol(scheme);
}];
-
+
m_customSchemeUnregisteredObserver = [[NSNotificationCenter defaultCenter] addObserverForName:WebKit::SchemeForCustomProtocolUnregisteredNotificationName object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
NSString *scheme = [notification object];
ASSERT([scheme isKindOfClass:[NSString class]]);
unregisterSchemeForCustomProtocol(scheme);
}];
-
+
// Listen for enhanced accessibility changes and propagate them to the WebProcess.
m_enhancedAccessibilityObserver = [[NSNotificationCenter defaultCenter] addObserverForName:WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *note) {
setEnhancedAccessibility([[[note userInfo] objectForKey:@"AXEnhancedUserInterface"] boolValue]);
}];
+
+ m_automaticTextReplacementNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSSpellCheckerDidChangeAutomaticTextReplacementNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
+ TextChecker::didChangeAutomaticTextReplacementEnabled();
+ textCheckerStateChanged();
+ }];
+
+ m_automaticSpellingCorrectionNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
+ TextChecker::didChangeAutomaticSpellingCorrectionEnabled();
+ textCheckerStateChanged();
+ }];
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ m_automaticQuoteSubstitutionNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSSpellCheckerDidChangeAutomaticQuoteSubstitutionNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
+ TextChecker::didChangeAutomaticQuoteSubstitutionEnabled();
+ textCheckerStateChanged();
+ }];
+
+ m_automaticDashSubstitutionNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSSpellCheckerDidChangeAutomaticDashSubstitutionNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
+ TextChecker::didChangeAutomaticDashSubstitutionEnabled();
+ textCheckerStateChanged();
+ }];
+#endif
}
void WebContext::unregisterNotificationObservers()
{
- [[NSNotificationCenter defaultCenter] removeObserver:(id)m_customSchemeRegisteredObserver.get()];
- [[NSNotificationCenter defaultCenter] removeObserver:(id)m_customSchemeUnregisteredObserver.get()];
- [[NSNotificationCenter defaultCenter] removeObserver:(id)m_enhancedAccessibilityObserver.get()];
+ [[NSNotificationCenter defaultCenter] removeObserver:m_customSchemeRegisteredObserver.get()];
+ [[NSNotificationCenter defaultCenter] removeObserver:m_customSchemeUnregisteredObserver.get()];
+ [[NSNotificationCenter defaultCenter] removeObserver:m_enhancedAccessibilityObserver.get()];
+
+ [[NSNotificationCenter defaultCenter] removeObserver:m_automaticTextReplacementNotificationObserver.get()];
+ [[NSNotificationCenter defaultCenter] removeObserver:m_automaticSpellingCorrectionNotificationObserver.get()];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ [[NSNotificationCenter defaultCenter] removeObserver:m_automaticQuoteSubstitutionNotificationObserver.get()];
+ [[NSNotificationCenter defaultCenter] removeObserver:m_automaticDashSubstitutionNotificationObserver.get()];
+#endif
}
} // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes