Changeset 169095 in webkit
- Timestamp:
- May 19, 2014, 7:22:35 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/PageClientImplIOS.mm (modified) (1 diff)
-
UIProcess/ios/WKContentView.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r169091 r169095 1 2014-05-19 Gavin Barraclough <baraclough@apple.com> 2 3 WebKit2/iOS: parented view should be considered hidden if app is backgrounded 4 https://bugs.webkit.org/show_bug.cgi?id=133099 5 radar://16942183 6 7 Reviewed by Simon Fraser. 8 9 * UIProcess/ios/PageClientImplIOS.mm: 10 (WebKit::PageClientImpl::isViewWindowActive): 11 - implemented in terms of isViewVisible. 12 - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 13 (WebKit::PageClientImpl::isViewFocused): 14 - implemented in terms of isViewWindowActive. 15 - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 16 (WebKit::PageClientImpl::isViewVisible): 17 - take UIApplication applicationState into account in determining visibility. 18 (WebKit::PageClientImpl::isViewVisibleOrOccluded): 19 - implemented in terms of isViewVisible. 20 (WebKit::PageClientImpl::isVisuallyIdle): 21 - implemented in terms of isViewVisible. 22 * UIProcess/ios/WKContentView.mm: 23 (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]): 24 - register for UIApplicationDidEnterBackgroundNotification. 25 (-[WKContentView _applicationDidEnterBackground:]): 26 (-[WKContentView _applicationWillEnterForeground:]): 27 - when the application state changes all flags except IsInWindow may be affected. 28 1 29 2014-05-19 Enrica Casucci <enrica@apple.com> 2 30 -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r168920 r169095 111 111 bool PageClientImpl::isViewWindowActive() 112 112 { 113 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 114 return isViewVisible(); 115 } 116 117 bool PageClientImpl::isViewFocused() 118 { 119 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 120 return isViewWindowActive(); 121 } 122 123 bool PageClientImpl::isViewVisible() 124 { 125 return [m_webView window] && [UIApplication sharedApplication].applicationState != UIApplicationStateBackground; 126 } 127 128 bool PageClientImpl::isViewInWindow() 129 { 113 130 return [m_webView window]; 114 131 } 115 132 116 bool PageClientImpl::isViewFocused()117 {118 return [m_webView window];119 }120 121 bool PageClientImpl::isViewVisible()122 {123 return [m_webView window];124 }125 126 bool PageClientImpl::isViewInWindow()127 {128 return [m_webView window];129 }130 131 133 bool PageClientImpl::isViewVisibleOrOccluded() 132 134 { 133 return [m_webView window];135 return isViewVisible(); 134 136 } 135 137 136 138 bool PageClientImpl::isVisuallyIdle() 137 139 { 138 return ! [m_webView window];140 return !isViewVisible(); 139 141 } 140 142 -
trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm
r169064 r169095 209 209 self.layer.hitTestsAsOpaque = YES; 210 210 211 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:[UIApplication sharedApplication]]; 211 212 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:[UIApplication sharedApplication]]; 212 213 213 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillResignActive:) name:UIApplicationWillResignActiveNotification object:[UIApplication sharedApplication]]; 214 215 214 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:[UIApplication sharedApplication]]; 216 215 … … 462 461 } 463 462 463 - (void)_applicationDidEnterBackground:(NSNotification*)notification 464 { 465 _page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow); 466 } 467 464 468 - (void)_applicationWillEnterForeground:(NSNotification*)notification 465 469 { 466 470 _page->applicationWillEnterForeground(); 471 _page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow); 467 472 } 468 473
Note:
See TracChangeset
for help on using the changeset viewer.