Changeset 30939 in webkit
- Timestamp:
- Mar 10, 2008 10:37:19 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r30937 r30939 1 2008-03-10 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam. 4 5 - eliminate keyboard UI mode method from WebCoreFrameBridge 6 7 * page/ChromeClient.h: Added keyboardUIMode function. 8 (WebCore::ChromeClient::keyboardUIMode): Ditto. 9 * page/mac/EventHandlerMac.mm: 10 (WebCore::EventHandler::tabsToAllControls): Call chrome client function instead 11 of bridge function. 12 * page/mac/WebCoreFrameBridge.h: Removed keyboardUIMode method, and other unused 13 ones. 14 15 * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to change the project. 16 Do not try to fight the Xcode. 17 1 18 2008-03-10 Darin Adler <darin@apple.com> 2 19 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r30923 r30939 8690 8690 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */, 8691 8691 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */, 8692 65D1C1C909932B22000CB324 /* Plugin.h */,8693 8692 BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */, 8694 8693 BCEC01BB0C274DAC009F4EC9 /* Screen.h */, -
trunk/WebCore/page/ChromeClient.h
r30900 r30939 26 26 #include <wtf/Vector.h> 27 27 28 typedef class _jobject* jobject; 28 #if PLATFORM(MAC) 29 #include "WebCoreKeyboardUIMode.h" 30 #endif 29 31 30 32 #ifndef __OBJC__ 31 33 class NSMenu; 32 34 class NSResponder; 33 class NSView;34 35 #endif 35 36 … … 124 125 virtual void populateVisitedLinks(); 125 126 126 #if PLATFORM(MAC)127 virtual void runOpenPanel(PassRefPtr<FileChooser>);128 #endif129 130 127 virtual FloatRect customHighlightRect(Node*, const AtomicString& type, const FloatRect& lineRect); 131 128 virtual void paintCustomHighlight(Node*, const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect, 132 129 bool behindText, bool entireLine); 130 131 #if PLATFORM(MAC) 132 virtual void runOpenPanel(PassRefPtr<FileChooser>); 133 134 virtual KeyboardUIMode keyboardUIMode() { return KeyboardAccessDefault; } 135 #endif 133 136 134 137 protected: -
trunk/WebCore/page/mac/EventHandlerMac.mm
r30742 r30939 28 28 29 29 #include "BlockExceptions.h" 30 #include "ChromeClient.h" 30 31 #include "ClipboardMac.h" 31 32 #include "EventNames.h" … … 106 107 bool EventHandler::tabsToAllControls(KeyboardEvent* event) const 107 108 { 108 KeyboardUIMode keyboardUIMode = [m_frame->bridge() keyboardUIMode]; 109 Page* page = m_frame->page(); 110 if (!page) 111 return false; 112 113 KeyboardUIMode keyboardUIMode = page->chrome()->client()->keyboardUIMode(); 109 114 bool handlingOptionTab = isKeyboardOptionTab(event); 110 115 -
trunk/WebCore/page/mac/WebCoreFrameBridge.h
r30935 r30939 179 179 - (void)willPopupMenu:(NSMenu *)menu; 180 180 181 - (WebCore::KeyboardUIMode)keyboardUIMode;182 183 181 @end 184 182 -
trunk/WebKit/mac/ChangeLog
r30935 r30939 1 2008-03-10 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam. 4 5 - eliminate keyboard UI mode method from WebCoreFrameBridge 6 7 * WebCoreSupport/WebChromeClient.h: Added keyboardUIMode function. 8 * WebCoreSupport/WebChromeClient.mm: 9 (WebChromeClient::keyboardUIMode): Ditto. Calls WebView. 10 * WebCoreSupport/WebFrameBridge.h: Removed unused things, including the 11 fields for keyboard UI mode. 12 * WebCoreSupport/WebFrameBridge.mm: 13 (-[WebFrameBridge dealloc]): Removed unneeded code; eliminated the fini 14 method. 15 (-[WebFrameBridge finalize]): Ditto. 16 * WebView/WebView.mm: Moved the keyboard mode code in here. 17 (-[WebView _close]): Remove observer from the distributed notification 18 center as well as the normal one. 19 (-[WebView _retrieveKeyboardUIModeFromPreferences:]): Added. Code moved 20 here from the bridge. 21 (-[WebView _keyboardUIMode]): Ditto. 22 * WebView/WebViewInternal.h: Added _keyboardUIMode method. 23 1 24 2008-03-10 Darin Adler <darin@apple.com> 2 25 -
trunk/WebKit/mac/WebCoreSupport/WebChromeClient.h
r30900 r30939 115 115 bool behindText, bool entireLine); 116 116 117 virtual WebCore::KeyboardUIMode keyboardUIMode(); 118 117 119 private: 118 120 WebView *m_webView; -
trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm
r30935 r30939 487 487 } 488 488 489 KeyboardUIMode WebChromeClient::keyboardUIMode() 490 { 491 return [m_webView _keyboardUIMode]; 492 } 493 489 494 @implementation WebOpenPanelResultListener 490 495 -
trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.h
r30741 r30939 37 37 @class WebFrameView; 38 38 39 @protocol WebOpenPanelResultListener;40 41 39 @interface WebFrameBridge : WebCoreFrameBridge <WebCoreFrameBridge> { 42 40 @public 43 41 WebFrame *_frame; 44 45 @private46 WebCore::KeyboardUIMode _keyboardUIMode;47 BOOL _keyboardUIModeAccessed;48 42 } 49 50 43 - (id)initMainFrameWithPage:(WebCore::Page*)page frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView; 51 44 - (id)initSubframeWithOwnerElement:(WebCore::HTMLFrameOwnerElement*)ownerElement frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView; 52 45 - (void)close; 53 54 46 - (WebFrame *)webFrame; 55 56 47 @end -
trunk/WebKit/mac/WebCoreSupport/WebFrameBridge.mm
r30935 r30939 103 103 using namespace WebCore; 104 104 105 #define KeyboardUIModeDidChangeNotification @"com.apple.KeyboardUIModeDidChange"106 #define AppleKeyboardUIMode CFSTR("AppleKeyboardUIMode")107 #define UniversalAccessDomain CFSTR("com.apple.universalaccess")108 109 105 @implementation WebFrameBridge 110 106 … … 154 150 } 155 151 156 - (void)fini 157 { 158 if (_keyboardUIModeAccessed) { 159 [[NSDistributedNotificationCenter defaultCenter] 160 removeObserver:self name:KeyboardUIModeDidChangeNotification object:nil]; 161 [[NSNotificationCenter defaultCenter] 162 removeObserver:self name:WebPreferencesChangedNotification object:nil]; 163 } 164 152 - (void)dealloc 153 { 165 154 ASSERT(_frame == nil); 166 155 --WebBridgeCount; 167 }168 169 - (void)dealloc170 {171 [_frame release];172 173 [self fini];174 156 [super dealloc]; 175 157 } … … 177 159 - (void)finalize 178 160 { 179 ASSERT _MAIN_THREAD();180 [self fini];161 ASSERT(_frame == nil); 162 --WebBridgeCount; 181 163 [super finalize]; 182 164 } 183 165 184 - (WebPreferences *)_preferences185 {186 return [[self webView] preferences];187 }188 189 - (void)_retrieveKeyboardUIModeFromPreferences:(NSNotification *)notification190 {191 CFPreferencesAppSynchronize(UniversalAccessDomain);192 193 Boolean keyExistsAndHasValidFormat;194 int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, UniversalAccessDomain, &keyExistsAndHasValidFormat);195 196 // The keyboard access mode is reported by two bits:197 // Bit 0 is set if feature is on198 // Bit 1 is set if full keyboard access works for any control, not just text boxes and lists199 // We require both bits to be on.200 // I do not know that we would ever get one bit on and the other off since201 // checking the checkbox in system preferences which is marked as "Turn on full keyboard access"202 // turns on both bits.203 _keyboardUIMode = (mode & 0x2) ? KeyboardAccessFull : KeyboardAccessDefault;204 205 // check for tabbing to links206 if ([[self _preferences] tabsToLinks])207 _keyboardUIMode = (KeyboardUIMode)(_keyboardUIMode | KeyboardAccessTabsToLinks);208 }209 210 - (KeyboardUIMode)keyboardUIMode211 {212 if (!_keyboardUIModeAccessed) {213 _keyboardUIModeAccessed = YES;214 [self _retrieveKeyboardUIModeFromPreferences:nil];215 216 [[NSDistributedNotificationCenter defaultCenter]217 addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)218 name:KeyboardUIModeDidChangeNotification object:nil];219 220 [[NSNotificationCenter defaultCenter]221 addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)222 name:WebPreferencesChangedNotification object:nil];223 }224 return _keyboardUIMode;225 }226 227 166 - (WebFrame *)webFrame 228 167 { 229 168 return _frame; 230 }231 232 - (WebCoreFrameBridge *)mainFrame233 {234 ASSERT(_frame != nil);235 return [[[self webView] mainFrame] _bridge];236 169 } 237 170 … … 255 188 } 256 189 257 - (WebDataSource *)dataSource258 {259 ASSERT(_frame != nil);260 WebDataSource *dataSource = [_frame _dataSource];261 262 ASSERT(dataSource != nil);263 264 return dataSource;265 }266 267 190 - (void)close 268 191 { -
trunk/WebKit/mac/WebView/WebView.mm
r30923 r30939 261 261 #define WebKitOriginalBottomPrintingMarginKey @"WebKitOriginalBottomMargin" 262 262 263 #define KeyboardUIModeDidChangeNotification @"com.apple.KeyboardUIModeDidChange" 264 #define AppleKeyboardUIMode CFSTR("AppleKeyboardUIMode") 265 #define UniversalAccessDomain CFSTR("com.apple.universalaccess") 266 263 267 static BOOL s_didSetCacheModel; 264 268 static WebCacheModel s_cacheModel = WebCacheModelDocumentViewer; … … 294 298 @end 295 299 296 @interface WebViewPrivate : NSObject 297 { 300 @interface WebViewPrivate : NSObject { 298 301 @public 299 302 Page* page; … … 365 368 366 369 HashMap<unsigned long, RetainPtr<id> >* identifierMap; 370 371 BOOL _keyboardUIModeAccessed; 372 KeyboardUIMode _keyboardUIMode; 367 373 } 368 374 @end … … 721 727 } 722 728 729 [[NSDistributedNotificationCenter defaultCenter] removeObserver:self]; 723 730 [[NSNotificationCenter defaultCenter] removeObserver:self]; 724 731 … … 4185 4192 } 4186 4193 4194 - (void)_retrieveKeyboardUIModeFromPreferences:(NSNotification *)notification 4195 { 4196 CFPreferencesAppSynchronize(UniversalAccessDomain); 4197 4198 Boolean keyExistsAndHasValidFormat; 4199 int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, UniversalAccessDomain, &keyExistsAndHasValidFormat); 4200 4201 // The keyboard access mode is reported by two bits: 4202 // Bit 0 is set if feature is on 4203 // Bit 1 is set if full keyboard access works for any control, not just text boxes and lists 4204 // We require both bits to be on. 4205 // I do not know that we would ever get one bit on and the other off since 4206 // checking the checkbox in system preferences which is marked as "Turn on full keyboard access" 4207 // turns on both bits. 4208 _private->_keyboardUIMode = (mode & 0x2) ? KeyboardAccessFull : KeyboardAccessDefault; 4209 4210 // check for tabbing to links 4211 if ([_private->preferences tabsToLinks]) 4212 _private->_keyboardUIMode = (KeyboardUIMode)(_private->_keyboardUIMode | KeyboardAccessTabsToLinks); 4213 } 4214 4215 - (KeyboardUIMode)_keyboardUIMode 4216 { 4217 if (!_private->_keyboardUIModeAccessed) { 4218 _private->_keyboardUIModeAccessed = YES; 4219 4220 [self _retrieveKeyboardUIModeFromPreferences:nil]; 4221 4222 [[NSDistributedNotificationCenter defaultCenter] 4223 addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:) 4224 name:KeyboardUIModeDidChangeNotification object:nil]; 4225 4226 [[NSNotificationCenter defaultCenter] 4227 addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:) 4228 name:WebPreferencesChangedNotification object:nil]; 4229 } 4230 return _private->_keyboardUIMode; 4231 } 4232 4187 4233 @end 4188 4234 -
trunk/WebKit/mac/WebView/WebViewInternal.h
r29698 r30939 27 27 */ 28 28 29 // This header contains WebView declarations that can be used anywhere in the WebKit, but are neither SPI nor API.29 // This header contains WebView declarations that can be used anywhere in WebKit, but are neither SPI nor API. 30 30 31 31 #import "WebPreferences.h" 32 32 #import "WebViewPrivate.h" 33 33 #import "WebTypesInternal.h" 34 35 #ifdef __cplusplus 36 #import <WebCore/WebCoreKeyboardUIMode.h> 37 #endif 34 38 35 39 #ifdef __cplusplus … … 64 68 #ifdef __cplusplus 65 69 - (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url; 70 - (WebCore::KeyboardUIMode)_keyboardUIMode; 66 71 #endif 67 72 @end
Note: See TracChangeset
for help on using the changeset viewer.