Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1930)

Unified Diff: content/renderer/render_view_impl.cc

Issue 944763002: Make Page Visibility API work when the browser window is visible or not Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use of SetWindowVisibility message Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | ui/aura/window_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index c9cbd6689944fbccc878e9e79f505e7f256630e5..e07114c4d06c59674f77383aea60ce3100ee57f9 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1326,6 +1326,7 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
OnReleaseDisambiguationPopupBitmap)
IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw)
IPC_MESSAGE_HANDLER(ViewMsg_SelectWordAroundCaret, OnSelectWordAroundCaret)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility)
#if defined(OS_ANDROID)
IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult,
OnActivateNearestFindResult)
@@ -1339,7 +1340,6 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_PluginImeCompositionCompleted,
OnPluginImeCompositionCompleted)
IPC_MESSAGE_HANDLER(ViewMsg_SetInLiveResize, OnSetInLiveResize)
- IPC_MESSAGE_HANDLER(ViewMsg_SetWindowVisibility, OnSetWindowVisibility)
IPC_MESSAGE_HANDLER(ViewMsg_WindowFrameChanged, OnWindowFrameChanged)
#endif
// Adding a new message? Add platform independent ones first, then put the
@@ -3016,8 +3016,8 @@ void RenderViewImpl::OnSetActive(bool active) {
#endif
}
-#if defined(OS_MACOSX)
void RenderViewImpl::OnSetWindowVisibility(bool visible) {
+#if defined(OS_MACOSX)
#if defined(ENABLE_PLUGINS)
// Inform plugins that their container has changed visibility.
std::set<WebPluginDelegateProxy*>::iterator plugin_it;
@@ -3026,8 +3026,15 @@ void RenderViewImpl::OnSetWindowVisibility(bool visible) {
(*plugin_it)->SetContainerVisibility(visible);
}
#endif
+#else
+ if (webview())
+ webview()->setVisibilityState(visible ?
+ blink::WebPageVisibilityStateVisible :
+ blink::WebPageVisibilityStateHidden, false);
+#endif
}
+#if defined(OS_MACOSX)
void RenderViewImpl::OnWindowFrameChanged(const gfx::Rect& window_frame,
const gfx::Rect& view_frame) {
#if defined(ENABLE_PLUGINS)
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | ui/aura/window_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698