Commit 37470d93 authored by cfleizach@apple.com's avatar cfleizach@apple.com

WK2: Need to propagate enhanced accessibility flag from UI -> web process

https://bugs.webkit.org/show_bug.cgi?id=56379

Reviewed by Darin Adler.

Source/WebCore: 

Allow the enhanced accessibility flag to be toggleable. 

* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility):

Source/WebKit/mac: 

* WebView/WebFrame.mm:
(-[WebFrame accessibilityRoot]):

Source/WebKit2: 

Support sending the enhanced accessibility flag between processes.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::~WebContext):
(WebKit::WebContext::setEnhancedAccessibility):
* UIProcess/WebContext.h:
* UIProcess/gtk/WebContextGtk.cpp:
(WebKit::WebContet::platformInvalidateContext):
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitializeWebProcess):
(WebKit::WebContext::platformInvalidateContext):
* UIProcess/qt/WebContextQt.cpp:
(WebKit::WebContext::platformInvalidateContext):
* UIProcess/win/WebContextWin.cpp:
(WebKit::WebContext::platformInvalidateContext):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setEnhancedAccessibility):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:



git-svn-id: svn://svn.chromium.org/blink/trunk@81274 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9c9e2495
2011-03-16 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
WK2: Need to propagate enhanced accessibility flag from UI -> web process
https://bugs.webkit.org/show_bug.cgi?id=56379
Allow the enhanced accessibility flag to be toggleable.
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility):
2011-03-16 Csaba Osztrogonác <ossy@webkit.org> 2011-03-16 Csaba Osztrogonác <ossy@webkit.org>
[Qt] Buildfix after r81230. [Qt] Buildfix after r81230.
......
...@@ -96,7 +96,8 @@ public: ...@@ -96,7 +96,8 @@ public:
void handleScrollbarUpdate(ScrollView*); void handleScrollbarUpdate(ScrollView*);
static void enableAccessibility() { gAccessibilityEnabled = true; } static void enableAccessibility() { gAccessibilityEnabled = true; }
static void enableEnhancedUserInterfaceAccessibility() { gAccessibilityEnhancedUserInterfaceEnabled = true; } // Enhanced user interface accessibility can be toggled by the assistive technology.
static void setEnhancedUserInterfaceAccessibility(bool flag) { gAccessibilityEnhancedUserInterfaceEnabled = flag; }
static bool accessibilityEnabled() { return gAccessibilityEnabled; } static bool accessibilityEnabled() { return gAccessibilityEnabled; }
static bool accessibilityEnhancedUserInterfaceEnabled() { return gAccessibilityEnhancedUserInterfaceEnabled; } static bool accessibilityEnhancedUserInterfaceEnabled() { return gAccessibilityEnhancedUserInterfaceEnabled; }
......
2011-03-16 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
WK2: Need to propagate enhanced accessibility flag from UI -> web process
https://bugs.webkit.org/show_bug.cgi?id=56379
* WebView/WebFrame.mm:
(-[WebFrame accessibilityRoot]):
2011-03-15 Oliver Hunt <oliver@apple.com> 2011-03-15 Oliver Hunt <oliver@apple.com>
Reviewed by Geoffrey Garen. Reviewed by Geoffrey Garen.
......
...@@ -1321,8 +1321,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) ...@@ -1321,8 +1321,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
#if HAVE(ACCESSIBILITY) #if HAVE(ACCESSIBILITY)
if (!AXObjectCache::accessibilityEnabled()) { if (!AXObjectCache::accessibilityEnabled()) {
AXObjectCache::enableAccessibility(); AXObjectCache::enableAccessibility();
if ([[NSApp accessibilityAttributeValue:NSAccessibilityEnhancedUserInterfaceAttribute] boolValue]) AXObjectCache::setEnhancedUserInterfaceAccessibility([[NSApp accessibilityAttributeValue:NSAccessibilityEnhancedUserInterfaceAttribute] boolValue]);
AXObjectCache::enableEnhancedUserInterfaceAccessibility();
} }
if (!_private->coreFrame || !_private->coreFrame->document()) if (!_private->coreFrame || !_private->coreFrame->document())
......
2011-03-16 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
WK2: Need to propagate enhanced accessibility flag from UI -> web process
https://bugs.webkit.org/show_bug.cgi?id=56379
Support sending the enhanced accessibility flag between processes.
* UIProcess/WebContext.cpp:
(WebKit::WebContext::~WebContext):
(WebKit::WebContext::setEnhancedAccessibility):
* UIProcess/WebContext.h:
* UIProcess/gtk/WebContextGtk.cpp:
(WebKit::WebContet::platformInvalidateContext):
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitializeWebProcess):
(WebKit::WebContext::platformInvalidateContext):
* UIProcess/qt/WebContextQt.cpp:
(WebKit::WebContext::platformInvalidateContext):
* UIProcess/win/WebContextWin.cpp:
(WebKit::WebContext::platformInvalidateContext):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setEnhancedAccessibility):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2011-03-15 Oliver Hunt <oliver@apple.com> 2011-03-15 Oliver Hunt <oliver@apple.com>
Reviewed by Geoffrey Garen. Reviewed by Geoffrey Garen.
......
...@@ -167,6 +167,8 @@ WebContext::~WebContext() ...@@ -167,6 +167,8 @@ WebContext::~WebContext()
m_resourceCacheManagerProxy->invalidate(); m_resourceCacheManagerProxy->invalidate();
m_resourceCacheManagerProxy->clearContext(); m_resourceCacheManagerProxy->clearContext();
platformInvalidateContext();
#ifndef NDEBUG #ifndef NDEBUG
webContextCounter.decrement(); webContextCounter.decrement();
#endif #endif
...@@ -698,6 +700,14 @@ void WebContext::clearApplicationCache() ...@@ -698,6 +700,14 @@ void WebContext::clearApplicationCache()
m_process->send(Messages::WebProcess::ClearApplicationCache(), 0); m_process->send(Messages::WebProcess::ClearApplicationCache(), 0);
} }
void WebContext::setEnhancedAccessibility(bool flag)
{
if (!hasValidProcess())
return;
m_process->send(Messages::WebProcess::SetEnhancedAccessibility(flag), 0);
}
void WebContext::startMemorySampler(const double interval) void WebContext::startMemorySampler(const double interval)
{ {
// For new WebProcesses we will also want to start the Memory Sampler // For new WebProcesses we will also want to start the Memory Sampler
......
...@@ -131,6 +131,8 @@ public: ...@@ -131,6 +131,8 @@ public:
void setShouldPaintNativeControls(bool); void setShouldPaintNativeControls(bool);
#endif #endif
void setEnhancedAccessibility(bool);
// Downloads. // Downloads.
uint64_t createDownloadProxy(); uint64_t createDownloadProxy();
WebDownloadClient& downloadClient() { return m_downloadClient; } WebDownloadClient& downloadClient() { return m_downloadClient; }
...@@ -167,6 +169,7 @@ private: ...@@ -167,6 +169,7 @@ private:
virtual Type type() const { return APIType; } virtual Type type() const { return APIType; }
void platformInitializeWebProcess(WebProcessCreationParameters&); void platformInitializeWebProcess(WebProcessCreationParameters&);
void platformInvalidateContext();
// History client // History client
void didNavigateWithNavigationData(uint64_t pageID, const WebNavigationDataStore& store, uint64_t frameID); void didNavigateWithNavigationData(uint64_t pageID, const WebNavigationDataStore& store, uint64_t frameID);
...@@ -246,6 +249,10 @@ private: ...@@ -246,6 +249,10 @@ private:
bool m_shouldPaintNativeControls; bool m_shouldPaintNativeControls;
#endif #endif
#if PLATFORM(MAC)
RetainPtr<CFTypeRef> m_enhancedAccessibilityObserver;
#endif
String m_overrideDatabaseDirectory; String m_overrideDatabaseDirectory;
String m_overrideIconDatabasePath; String m_overrideIconDatabasePath;
String m_overrideLocalStorageDirectory; String m_overrideLocalStorageDirectory;
......
...@@ -41,6 +41,10 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters&) ...@@ -41,6 +41,10 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters&)
{ {
} }
void WebContext::platformInvalidateContext()
{
}
String WebContext::platformDefaultDatabaseDirectory() const String WebContext::platformDefaultDatabaseDirectory() const
{ {
return WTF::String::fromUTF8(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL)); return WTF::String::fromUTF8(g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL));
......
...@@ -37,6 +37,8 @@ NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory"; ...@@ -37,6 +37,8 @@ NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory";
NSString *WebKitLocalCacheDefaultsKey = @"WebKitLocalCache"; NSString *WebKitLocalCacheDefaultsKey = @"WebKitLocalCache";
NSString *WebStorageDirectoryDefaultsKey = @"WebKitLocalStorageDatabasePathPreferenceKey"; NSString *WebStorageDirectoryDefaultsKey = @"WebKitLocalStorageDatabasePathPreferenceKey";
static NSString *WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification = @"NSApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification";
// FIXME: <rdar://problem/9138817> - After this "backwards compatibility" radar is removed, this code should be removed to only return an empty String. // FIXME: <rdar://problem/9138817> - After this "backwards compatibility" radar is removed, this code should be removed to only return an empty String.
NSString *WebIconDatabaseDirectoryDefaultsKey = @"WebIconDatabaseDirectoryDefaultsKey"; NSString *WebIconDatabaseDirectoryDefaultsKey = @"WebIconDatabaseDirectoryDefaultsKey";
...@@ -101,6 +103,16 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para ...@@ -101,6 +103,16 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
#if USE(CFURLSTORAGESESSIONS) #if USE(CFURLSTORAGESESSIONS)
parameters.uiProcessBundleIdentifier = String([[NSBundle mainBundle] bundleIdentifier]); parameters.uiProcessBundleIdentifier = String([[NSBundle mainBundle] bundleIdentifier]);
#endif #endif
// 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]);
}];
}
void WebContext::platformInvalidateContext()
{
[[NSNotificationCenter defaultCenter] removeObserver:(id)m_enhancedAccessibilityObserver.get()];
} }
String WebContext::platformDefaultDatabaseDirectory() const String WebContext::platformDefaultDatabaseDirectory() const
......
...@@ -47,6 +47,10 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters&) ...@@ -47,6 +47,10 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters&)
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus"); qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
} }
void WebContext::platformInvalidateContext()
{
}
String WebContext::platformDefaultDatabaseDirectory() const String WebContext::platformDefaultDatabaseDirectory() const
{ {
// FIXME: Implement. // FIXME: Implement.
......
...@@ -76,6 +76,10 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para ...@@ -76,6 +76,10 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
#endif // USE(CFNETWORK) #endif // USE(CFNETWORK)
} }
void WebContext::platformInvalidateContext()
{
}
String WebContext::platformDefaultDatabaseDirectory() const String WebContext::platformDefaultDatabaseDirectory() const
{ {
return WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases"); return WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases");
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "WebProcessMessages.h" #include "WebProcessMessages.h"
#include "WebProcessProxyMessages.h" #include "WebProcessProxyMessages.h"
#include "WebResourceCacheManager.h" #include "WebResourceCacheManager.h"
#include <WebCore/AXObjectCache.h>
#include <WebCore/ApplicationCacheStorage.h> #include <WebCore/ApplicationCacheStorage.h>
#include <WebCore/CrossOriginPreflightResultCache.h> #include <WebCore/CrossOriginPreflightResultCache.h>
#include <WebCore/Font.h> #include <WebCore/Font.h>
...@@ -777,6 +778,11 @@ void WebProcess::cancelDownload(uint64_t downloadID) ...@@ -777,6 +778,11 @@ void WebProcess::cancelDownload(uint64_t downloadID)
DownloadManager::shared().cancelDownload(downloadID); DownloadManager::shared().cancelDownload(downloadID);
} }
void WebProcess::setEnhancedAccessibility(bool flag)
{
WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility(flag);
}
void WebProcess::startMemorySampler(const SandboxExtension::Handle& sampleLogFileHandle, const String& sampleLogFilePath, const double interval) void WebProcess::startMemorySampler(const SandboxExtension::Handle& sampleLogFileHandle, const String& sampleLogFilePath, const double interval)
{ {
#if ENABLE(MEMORY_SAMPLER) #if ENABLE(MEMORY_SAMPLER)
......
...@@ -152,6 +152,8 @@ private: ...@@ -152,6 +152,8 @@ private:
void platformClearResourceCaches(ResourceCachesToClear); void platformClearResourceCaches(ResourceCachesToClear);
void clearApplicationCache(); void clearApplicationCache();
void setEnhancedAccessibility(bool);
#if !ENABLE(PLUGIN_PROCESS) #if !ENABLE(PLUGIN_PROCESS)
void getSitesWithPluginData(const Vector<String>& pluginPaths, uint64_t callbackID); void getSitesWithPluginData(const Vector<String>& pluginPaths, uint64_t callbackID);
void clearPluginSiteData(const Vector<String>& pluginPaths, const Vector<String>& sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID); void clearPluginSiteData(const Vector<String>& pluginPaths, const Vector<String>& sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID);
......
...@@ -63,4 +63,6 @@ messages -> WebProcess { ...@@ -63,4 +63,6 @@ messages -> WebProcess {
CancelDownload(uint64_t downloadID) CancelDownload(uint64_t downloadID)
SetTextCheckerState(WebKit::TextCheckerState textCheckerState) SetTextCheckerState(WebKit::TextCheckerState textCheckerState)
SetEnhancedAccessibility(bool flag)
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment