Diff
Modified: trunk/Source/WebKit2/ChangeLog (157971 => 157972)
--- trunk/Source/WebKit2/ChangeLog 2013-10-25 01:15:36 UTC (rev 157971)
+++ trunk/Source/WebKit2/ChangeLog 2013-10-25 01:17:59 UTC (rev 157972)
@@ -1,3 +1,31 @@
+2013-10-24 Gavin Barraclough <[email protected]>
+
+ Fold updateWindowIsVisible into viewStateDidChange
+ https://bugs.webkit.org/show_bug.cgi?id=123305
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/API/mac/PageClientImpl.h:
+ * UIProcess/API/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::isWindowVisible):
+ - Added accessor to check if window is visible
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView viewDidMoveToWindow]):
+ (-[WKView _windowDidMiniaturize:]):
+ (-[WKView _windowDidDeminiaturize:]):
+ (-[WKView _windowDidOrderOffScreen:]):
+ (-[WKView _windowDidOrderOnScreen:]):
+ - _updateWindowVisibility -> viewStateDidChange
+ * UIProcess/PageClient.h:
+ - Added accessor to check if winow is visible
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::viewStateDidChange):
+ - handle WindowIsVisible
+ * UIProcess/WebPageProxy.h:
+ - added WindowIsVisible
+ * UIProcess/mac/WebPageProxyMac.mm:
+ - removed updateWindowIsVisible
+
2013-10-24 Anders Carlsson <[email protected]>
Stop bringing in the std namespace
Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h (157971 => 157972)
--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h 2013-10-25 01:15:36 UTC (rev 157971)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h 2013-10-25 01:17:59 UTC (rev 157972)
@@ -58,6 +58,7 @@
virtual bool isViewWindowActive();
virtual bool isViewFocused();
virtual bool isViewVisible();
+ virtual bool isWindowVisible();
virtual bool isViewInWindow();
virtual LayerHostingMode viewLayerHostingMode() OVERRIDE;
virtual ColorSpaceData colorSpace() OVERRIDE;
Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm (157971 => 157972)
--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm 2013-10-25 01:15:36 UTC (rev 157971)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm 2013-10-25 01:17:59 UTC (rev 157972)
@@ -210,6 +210,11 @@
return true;
}
+bool PageClientImpl::isWindowVisible()
+{
+ return [[m_wkView window] isVisible];
+}
+
bool PageClientImpl::isViewInWindow()
{
return [m_wkView window];
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (157971 => 157972)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-10-25 01:15:36 UTC (rev 157971)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-10-25 01:17:59 UTC (rev 157972)
@@ -1844,12 +1844,6 @@
return NSMouseInRect(localPoint, visibleThumbRect, [self isFlipped]);
}
-- (void)_updateWindowVisibility
-{
- _data->_page->updateWindowIsVisible([[self window] isVisible]);
-}
-
-
// FIXME: Use AppKit constants for these when they are available.
static NSString * const windowDidChangeBackingPropertiesNotification = @"NSWindowDidChangeBackingPropertiesNotification";
static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey";
@@ -1935,7 +1929,7 @@
if ([self window]) {
_data->_windowHasValidBackingStore = NO;
[self doWindowDidChangeScreen];
- [self _updateWindowVisibility];
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible);
_data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive);
if ([self isDeferringViewInWindowChanges]) {
@@ -1955,7 +1949,7 @@
[self _accessibilityRegisterUIProcessTokens];
} else {
- [self _updateWindowVisibility];
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible);
_data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
if ([self isDeferringViewInWindowChanges]) {
@@ -2004,13 +1998,12 @@
- (void)_windowDidMiniaturize:(NSNotification *)notification
{
_data->_windowHasValidBackingStore = NO;
-
- [self _updateWindowVisibility];
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible);
}
- (void)_windowDidDeminiaturize:(NSNotification *)notification
{
- [self _updateWindowVisibility];
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible);
}
- (void)_windowDidMove:(NSNotification *)notification
@@ -2027,20 +2020,18 @@
- (void)_windowDidOrderOffScreen:(NSNotification *)notification
{
- [self _updateWindowVisibility];
-
// We want to make sure to update the active state while hidden, so since the view is about to be hidden,
// we hide it first and then update the active state.
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible);
_data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
_data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive);
}
- (void)_windowDidOrderOnScreen:(NSNotification *)notification
{
- [self _updateWindowVisibility];
-
// We want to make sure to update the active state while hidden, so since the view is about to become visible,
// we update the active state first and then make it visible.
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible);
_data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive);
_data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
}
Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (157971 => 157972)
--- trunk/Source/WebKit2/UIProcess/PageClient.h 2013-10-25 01:15:36 UTC (rev 157971)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h 2013-10-25 01:17:59 UTC (rev 157972)
@@ -99,6 +99,9 @@
// Return whether the view is visible.
virtual bool isViewVisible() = 0;
+ // Return whether the window is visible.
+ virtual bool isWindowVisible() = 0;
+
// Return whether the view is in a window.
virtual bool isViewInWindow() = 0;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (157971 => 157972)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-10-25 01:15:36 UTC (rev 157971)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-10-25 01:17:59 UTC (rev 157972)
@@ -996,6 +996,9 @@
if (!isValid())
return;
+ if (flags & WindowIsVisible)
+ process()->send(Messages::WebPage::SetWindowIsVisible(m_pageClient->isWindowVisible()), m_pageID);
+
if (flags & ViewIsFocused)
m_process->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (157971 => 157972)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-10-25 01:15:36 UTC (rev 157971)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-10-25 01:17:59 UTC (rev 157972)
@@ -328,6 +328,7 @@
ViewIsFocused = 1 << 1,
ViewIsVisible = 1 << 2,
ViewIsInWindow = 1 << 3,
+ WindowIsVisible = 1 << 4
};
typedef unsigned ViewStateFlags;
void viewStateDidChange(ViewStateFlags flags);
@@ -368,7 +369,6 @@
#endif
#if PLATFORM(MAC)
- void updateWindowIsVisible(bool windowIsVisible);
void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
void viewExposedRectChanged(const WebCore::FloatRect& exposedRect, bool);
void exposedRectChangedTimerFired(WebCore::Timer<WebPageProxy>*);
Modified: trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (157971 => 157972)
--- trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm 2013-10-25 01:15:36 UTC (rev 157971)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm 2013-10-25 01:17:59 UTC (rev 157972)
@@ -143,13 +143,6 @@
return m_pageClient->containingWindowGraphicsContext();
}
-void WebPageProxy::updateWindowIsVisible(bool windowIsVisible)
-{
- if (!isValid())
- return;
- process()->send(Messages::WebPage::SetWindowIsVisible(windowIsVisible), m_pageID);
-}
-
void WebPageProxy::windowAndViewFramesChanged(const FloatRect& viewFrameInWindowCoordinates, const FloatPoint& accessibilityViewCoordinates)
{
if (!isValid())