<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[30939] trunk</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/30939">30939</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2008-03-10 10:37:19 -0700 (Mon, 10 Mar 2008)</dd>
</dl>
<h3>Log Message</h3>
<pre>WebCore:
Reviewed by Sam.
- eliminate keyboard UI mode method from WebCoreFrameBridge
* page/ChromeClient.h: Added keyboardUIMode function.
(WebCore::ChromeClient::keyboardUIMode): Ditto.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::tabsToAllControls): Call chrome client function instead
of bridge function.
* page/mac/WebCoreFrameBridge.h: Removed keyboardUIMode method, and other unused
ones.
* WebCore.xcodeproj/project.pbxproj: Allowed Xcode to change the project.
Do not try to fight the Xcode.
WebKit/mac:
Reviewed by Sam.
- eliminate keyboard UI mode method from WebCoreFrameBridge
* WebCoreSupport/WebChromeClient.h: Added keyboardUIMode function.
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::keyboardUIMode): Ditto. Calls WebView.
* WebCoreSupport/WebFrameBridge.h: Removed unused things, including the
fields for keyboard UI mode.
* WebCoreSupport/WebFrameBridge.mm:
(-[WebFrameBridge dealloc]): Removed unneeded code; eliminated the fini
method.
(-[WebFrameBridge finalize]): Ditto.
* WebView/WebView.mm: Moved the keyboard mode code in here.
(-[WebView _close]): Remove observer from the distributed notification
center as well as the normal one.
(-[WebView _retrieveKeyboardUIModeFromPreferences:]): Added. Code moved
here from the bridge.
(-[WebView _keyboardUIMode]): Ditto.
* WebView/WebViewInternal.h: Added _keyboardUIMode method.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreWebCorexcodeprojprojectpbxproj">trunk/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkWebCorepageChromeClienth">trunk/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkWebCorepagemacEventHandlerMacmm">trunk/WebCore/page/mac/EventHandlerMac.mm</a></li>
<li><a href="#trunkWebCorepagemacWebCoreFrameBridgeh">trunk/WebCore/page/mac/WebCoreFrameBridge.h</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebChromeClienth">trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebChromeClientmm">trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebFrameBridgeh">trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.h</a></li>
<li><a href="#trunkWebKitmacWebCoreSupportWebFrameBridgemm">trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.mm</a></li>
<li><a href="#trunkWebKitmacWebViewWebViewmm">trunk/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkWebKitmacWebViewWebViewInternalh">trunk/WebKit/mac/WebView/WebViewInternal.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebCore/ChangeLog 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2008-03-10 Darin Adler <darin@apple.com>
</span><span class="cx">
</span><ins>+ Reviewed by Sam.
+
+ - eliminate keyboard UI mode method from WebCoreFrameBridge
+
+ * page/ChromeClient.h: Added keyboardUIMode function.
+ (WebCore::ChromeClient::keyboardUIMode): Ditto.
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::EventHandler::tabsToAllControls): Call chrome client function instead
+ of bridge function.
+ * page/mac/WebCoreFrameBridge.h: Removed keyboardUIMode method, and other unused
+ ones.
+
+ * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to change the project.
+ Do not try to fight the Xcode.
+
+2008-03-10 Darin Adler <darin@apple.com>
+
</ins><span class="cx"> - oops, forgot to save last couple changes from the editor
</span><span class="cx">
</span><span class="cx"> * bindings/js/JSDOMWindowCustom.cpp:
</span></span></pre></div>
<a id="trunkWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.xcodeproj/project.pbxproj (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.xcodeproj/project.pbxproj 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebCore/WebCore.xcodeproj/project.pbxproj 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -8689,7 +8689,6 @@
</span><span class="cx"> 65A21467097A329100B9050A /* Page.h */,
</span><span class="cx"> 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */,
</span><span class="cx"> 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */,
</span><del>- 65D1C1C909932B22000CB324 /* Plugin.h */,
</del><span class="cx"> BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */,
</span><span class="cx"> BCEC01BB0C274DAC009F4EC9 /* Screen.h */,
</span><span class="cx"> BCEC01BC0C274DAC009F4EC9 /* Screen.idl */,
</span></span></pre></div>
<a id="trunkWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/ChromeClient.h (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/ChromeClient.h 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebCore/page/ChromeClient.h 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -25,12 +25,13 @@
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><del>-typedef class _jobject* jobject;
</del><ins>+#if PLATFORM(MAC)
+#include "WebCoreKeyboardUIMode.h"
+#endif
</ins><span class="cx">
</span><span class="cx"> #ifndef __OBJC__
</span><span class="cx"> class NSMenu;
</span><span class="cx"> class NSResponder;
</span><del>-class NSView;
</del><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -123,14 +124,16 @@
</span><span class="cx">
</span><span class="cx"> virtual void populateVisitedLinks();
</span><span class="cx">
</span><ins>+ virtual FloatRect customHighlightRect(Node*, const AtomicString& type, const FloatRect& lineRect);
+ virtual void paintCustomHighlight(Node*, const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect,
+ bool behindText, bool entireLine);
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> virtual void runOpenPanel(PassRefPtr<FileChooser>);
</span><ins>+
+ virtual KeyboardUIMode keyboardUIMode() { return KeyboardAccessDefault; }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- virtual FloatRect customHighlightRect(Node*, const AtomicString& type, const FloatRect& lineRect);
- virtual void paintCustomHighlight(Node*, const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect,
- bool behindText, bool entireLine);
-
</del><span class="cx"> protected:
</span><span class="cx"> virtual ~ChromeClient() { }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkWebCorepagemacEventHandlerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/mac/EventHandlerMac.mm (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/mac/EventHandlerMac.mm 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebCore/page/mac/EventHandlerMac.mm 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "EventHandler.h"
</span><span class="cx">
</span><span class="cx"> #include "BlockExceptions.h"
</span><ins>+#include "ChromeClient.h"
</ins><span class="cx"> #include "ClipboardMac.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="cx"> #include "FocusController.h"
</span><span class="lines">@@ -105,7 +106,11 @@
</span><span class="cx">
</span><span class="cx"> bool EventHandler::tabsToAllControls(KeyboardEvent* event) const
</span><span class="cx"> {
</span><del>- KeyboardUIMode keyboardUIMode = [m_frame->bridge() keyboardUIMode];
</del><ins>+ Page* page = m_frame->page();
+ if (!page)
+ return false;
+
+ KeyboardUIMode keyboardUIMode = page->chrome()->client()->keyboardUIMode();
</ins><span class="cx"> bool handlingOptionTab = isKeyboardOptionTab(event);
</span><span class="cx">
</span><span class="cx"> // If tab-to-links is off, option-tab always highlights all controls
</span></span></pre></div>
<a id="trunkWebCorepagemacWebCoreFrameBridgeh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/mac/WebCoreFrameBridge.h (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/mac/WebCoreFrameBridge.h 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebCore/page/mac/WebCoreFrameBridge.h 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -178,8 +178,6 @@
</span><span class="cx">
</span><span class="cx"> - (void)willPopupMenu:(NSMenu *)menu;
</span><span class="cx">
</span><del>-- (WebCore::KeyboardUIMode)keyboardUIMode;
-
</del><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> // This interface definition allows those who hold a WebCoreFrameBridge * to call all the methods
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebKit/mac/ChangeLog 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -2,6 +2,29 @@
</span><span class="cx">
</span><span class="cx"> Reviewed by Sam.
</span><span class="cx">
</span><ins>+ - eliminate keyboard UI mode method from WebCoreFrameBridge
+
+ * WebCoreSupport/WebChromeClient.h: Added keyboardUIMode function.
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::keyboardUIMode): Ditto. Calls WebView.
+ * WebCoreSupport/WebFrameBridge.h: Removed unused things, including the
+ fields for keyboard UI mode.
+ * WebCoreSupport/WebFrameBridge.mm:
+ (-[WebFrameBridge dealloc]): Removed unneeded code; eliminated the fini
+ method.
+ (-[WebFrameBridge finalize]): Ditto.
+ * WebView/WebView.mm: Moved the keyboard mode code in here.
+ (-[WebView _close]): Remove observer from the distributed notification
+ center as well as the normal one.
+ (-[WebView _retrieveKeyboardUIModeFromPreferences:]): Added. Code moved
+ here from the bridge.
+ (-[WebView _keyboardUIMode]): Ditto.
+ * WebView/WebViewInternal.h: Added _keyboardUIMode method.
+
+2008-03-10 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam.
+
</ins><span class="cx"> - eliminate Java applet methods from WebCoreFrameBridge
</span><span class="cx">
</span><span class="cx"> * WebCoreSupport/WebChromeClient.mm: Removed unneeded headers and declarations.
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -114,6 +114,8 @@
</span><span class="cx"> const WebCore::FloatRect& boxRect, const WebCore::FloatRect& lineRect,
</span><span class="cx"> bool behindText, bool entireLine);
</span><span class="cx">
</span><ins>+ virtual WebCore::KeyboardUIMode keyboardUIMode();
+
</ins><span class="cx"> private:
</span><span class="cx"> WebView *m_webView;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -486,6 +486,11 @@
</span><span class="cx"> [listener release];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+KeyboardUIMode WebChromeClient::keyboardUIMode()
+{
+ return [m_webView _keyboardUIMode];
+}
+
</ins><span class="cx"> @implementation WebOpenPanelResultListener
</span><span class="cx">
</span><span class="cx"> - (id)initWithChooser:(PassRefPtr<FileChooser>)chooser
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebFrameBridgeh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.h (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.h 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.h 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -36,21 +36,12 @@
</span><span class="cx"> @class WebFrame;
</span><span class="cx"> @class WebFrameView;
</span><span class="cx">
</span><del>-@protocol WebOpenPanelResultListener;
-
</del><span class="cx"> @interface WebFrameBridge : WebCoreFrameBridge <WebCoreFrameBridge> {
</span><span class="cx"> @public
</span><span class="cx"> WebFrame *_frame;
</span><del>-
-@private
- WebCore::KeyboardUIMode _keyboardUIMode;
- BOOL _keyboardUIModeAccessed;
</del><span class="cx"> }
</span><del>-
</del><span class="cx"> - (id)initMainFrameWithPage:(WebCore::Page*)page frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView;
</span><span class="cx"> - (id)initSubframeWithOwnerElement:(WebCore::HTMLFrameOwnerElement*)ownerElement frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView;
</span><span class="cx"> - (void)close;
</span><del>-
</del><span class="cx"> - (WebFrame *)webFrame;
</span><del>-
</del><span class="cx"> @end
</span></span></pre></div>
<a id="trunkWebKitmacWebCoreSupportWebFrameBridgemm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.mm (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.mm 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.mm 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -102,10 +102,6 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><del>-#define KeyboardUIModeDidChangeNotification @"com.apple.KeyboardUIModeDidChange"
-#define AppleKeyboardUIMode CFSTR("AppleKeyboardUIMode")
-#define UniversalAccessDomain CFSTR("com.apple.universalaccess")
-
</del><span class="cx"> @implementation WebFrameBridge
</span><span class="cx">
</span><span class="cx"> #ifndef BUILDING_ON_TIGER
</span><span class="lines">@@ -153,88 +149,25 @@
</span><span class="cx"> return self;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)fini
</del><ins>+- (void)dealloc
</ins><span class="cx"> {
</span><del>- if (_keyboardUIModeAccessed) {
- [[NSDistributedNotificationCenter defaultCenter]
- removeObserver:self name:KeyboardUIModeDidChangeNotification object:nil];
- [[NSNotificationCenter defaultCenter]
- removeObserver:self name:WebPreferencesChangedNotification object:nil];
- }
-
</del><span class="cx"> ASSERT(_frame == nil);
</span><span class="cx"> --WebBridgeCount;
</span><del>-}
-
-- (void)dealloc
-{
- [_frame release];
-
- [self fini];
</del><span class="cx"> [super dealloc];
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)finalize
</span><span class="cx"> {
</span><del>- ASSERT_MAIN_THREAD();
- [self fini];
</del><ins>+ ASSERT(_frame == nil);
+ --WebBridgeCount;
</ins><span class="cx"> [super finalize];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (WebPreferences *)_preferences
-{
- return [[self webView] preferences];
-}
-
-- (void)_retrieveKeyboardUIModeFromPreferences:(NSNotification *)notification
-{
- CFPreferencesAppSynchronize(UniversalAccessDomain);
-
- Boolean keyExistsAndHasValidFormat;
- int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, UniversalAccessDomain, &keyExistsAndHasValidFormat);
-
- // The keyboard access mode is reported by two bits:
- // Bit 0 is set if feature is on
- // Bit 1 is set if full keyboard access works for any control, not just text boxes and lists
- // We require both bits to be on.
- // I do not know that we would ever get one bit on and the other off since
- // checking the checkbox in system preferences which is marked as "Turn on full keyboard access"
- // turns on both bits.
- _keyboardUIMode = (mode & 0x2) ? KeyboardAccessFull : KeyboardAccessDefault;
-
- // check for tabbing to links
- if ([[self _preferences] tabsToLinks])
- _keyboardUIMode = (KeyboardUIMode)(_keyboardUIMode | KeyboardAccessTabsToLinks);
-}
-
-- (KeyboardUIMode)keyboardUIMode
-{
- if (!_keyboardUIModeAccessed) {
- _keyboardUIModeAccessed = YES;
- [self _retrieveKeyboardUIModeFromPreferences:nil];
-
- [[NSDistributedNotificationCenter defaultCenter]
- addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
- name:KeyboardUIModeDidChangeNotification object:nil];
-
- [[NSNotificationCenter defaultCenter]
- addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
- name:WebPreferencesChangedNotification object:nil];
- }
- return _keyboardUIMode;
-}
-
</del><span class="cx"> - (WebFrame *)webFrame
</span><span class="cx"> {
</span><span class="cx"> return _frame;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (WebCoreFrameBridge *)mainFrame
-{
- ASSERT(_frame != nil);
- return [[[self webView] mainFrame] _bridge];
-}
-
</del><span class="cx"> - (NSResponder *)firstResponder
</span><span class="cx"> {
</span><span class="cx"> ASSERT(_frame != nil);
</span><span class="lines">@@ -254,16 +187,6 @@
</span><span class="cx"> [webView _popPerformingProgrammaticFocus];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (WebDataSource *)dataSource
-{
- ASSERT(_frame != nil);
- WebDataSource *dataSource = [_frame _dataSource];
-
- ASSERT(dataSource != nil);
-
- return dataSource;
-}
-
</del><span class="cx"> - (void)close
</span><span class="cx"> {
</span><span class="cx"> [super close];
</span></span></pre></div>
<a id="trunkWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebView/WebView.mm (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebView/WebView.mm 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebKit/mac/WebView/WebView.mm 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -260,6 +260,10 @@
</span><span class="cx"> #define WebKitOriginalTopPrintingMarginKey @"WebKitOriginalTopMargin"
</span><span class="cx"> #define WebKitOriginalBottomPrintingMarginKey @"WebKitOriginalBottomMargin"
</span><span class="cx">
</span><ins>+#define KeyboardUIModeDidChangeNotification @"com.apple.KeyboardUIModeDidChange"
+#define AppleKeyboardUIMode CFSTR("AppleKeyboardUIMode")
+#define UniversalAccessDomain CFSTR("com.apple.universalaccess")
+
</ins><span class="cx"> static BOOL s_didSetCacheModel;
</span><span class="cx"> static WebCacheModel s_cacheModel = WebCacheModelDocumentViewer;
</span><span class="cx">
</span><span class="lines">@@ -293,8 +297,7 @@
</span><span class="cx"> - (id)initWithTarget:(id)target defaultTarget:(id)defaultTarget catchExceptions:(BOOL)catchExceptions;
</span><span class="cx"> @end
</span><span class="cx">
</span><del>-@interface WebViewPrivate : NSObject
-{
</del><ins>+@interface WebViewPrivate : NSObject {
</ins><span class="cx"> @public
</span><span class="cx"> Page* page;
</span><span class="cx">
</span><span class="lines">@@ -364,6 +367,9 @@
</span><span class="cx"> WebPluginDatabase *pluginDatabase;
</span><span class="cx">
</span><span class="cx"> HashMap<unsigned long, RetainPtr<id> >* identifierMap;
</span><ins>+
+ BOOL _keyboardUIModeAccessed;
+ KeyboardUIMode _keyboardUIMode;
</ins><span class="cx"> }
</span><span class="cx"> @end
</span><span class="cx">
</span><span class="lines">@@ -720,6 +726,7 @@
</span><span class="cx"> _private->hasSpellCheckerDocumentTag = NO;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ [[NSDistributedNotificationCenter defaultCenter] removeObserver:self];
</ins><span class="cx"> [[NSNotificationCenter defaultCenter] removeObserver:self];
</span><span class="cx">
</span><span class="cx"> [WebPreferences _removeReferenceForIdentifier:[self preferencesIdentifier]];
</span><span class="lines">@@ -4184,6 +4191,45 @@
</span><span class="cx"> CFRelease(self);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (void)_retrieveKeyboardUIModeFromPreferences:(NSNotification *)notification
+{
+ CFPreferencesAppSynchronize(UniversalAccessDomain);
+
+ Boolean keyExistsAndHasValidFormat;
+ int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, UniversalAccessDomain, &keyExistsAndHasValidFormat);
+
+ // The keyboard access mode is reported by two bits:
+ // Bit 0 is set if feature is on
+ // Bit 1 is set if full keyboard access works for any control, not just text boxes and lists
+ // We require both bits to be on.
+ // I do not know that we would ever get one bit on and the other off since
+ // checking the checkbox in system preferences which is marked as "Turn on full keyboard access"
+ // turns on both bits.
+ _private->_keyboardUIMode = (mode & 0x2) ? KeyboardAccessFull : KeyboardAccessDefault;
+
+ // check for tabbing to links
+ if ([_private->preferences tabsToLinks])
+ _private->_keyboardUIMode = (KeyboardUIMode)(_private->_keyboardUIMode | KeyboardAccessTabsToLinks);
+}
+
+- (KeyboardUIMode)_keyboardUIMode
+{
+ if (!_private->_keyboardUIModeAccessed) {
+ _private->_keyboardUIModeAccessed = YES;
+
+ [self _retrieveKeyboardUIModeFromPreferences:nil];
+
+ [[NSDistributedNotificationCenter defaultCenter]
+ addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
+ name:KeyboardUIModeDidChangeNotification object:nil];
+
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
+ name:WebPreferencesChangedNotification object:nil];
+ }
+ return _private->_keyboardUIMode;
+}
+
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> // We use these functions to call the delegates and block exceptions. These functions are
</span></span></pre></div>
<a id="trunkWebKitmacWebViewWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/WebView/WebViewInternal.h (30938 => 30939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/WebView/WebViewInternal.h 2008-03-10 17:36:54 UTC (rev 30938)
+++ trunk/WebKit/mac/WebView/WebViewInternal.h 2008-03-10 17:37:19 UTC (rev 30939)
</span><span class="lines">@@ -26,13 +26,17 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-// This header contains WebView declarations that can be used anywhere in the Web Kit, but are neither SPI nor API.
</del><ins>+// This header contains WebView declarations that can be used anywhere in WebKit, but are neither SPI nor API.
</ins><span class="cx">
</span><span class="cx"> #import "WebPreferences.h"
</span><span class="cx"> #import "WebViewPrivate.h"
</span><span class="cx"> #import "WebTypesInternal.h"
</span><span class="cx">
</span><span class="cx"> #ifdef __cplusplus
</span><ins>+#import <WebCore/WebCoreKeyboardUIMode.h>
+#endif
+
+#ifdef __cplusplus
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> class KeyboardEvent;
</span><span class="cx"> class KURL;
</span><span class="lines">@@ -63,6 +67,7 @@
</span><span class="cx"> @interface WebView (WebViewInternal)
</span><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> - (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url;
</span><ins>+- (WebCore::KeyboardUIMode)_keyboardUIMode;
</ins><span class="cx"> #endif
</span><span class="cx"> @end
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>