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

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 784553002: Hide the Legacy HWND when the RWHVA is destroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new_legacy_debug
Patch Set: Use WebContentsObserver Created 6 years 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/browser/web_contents/web_contents_view_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 783fccc0b8f4c61f985a18e3ea8c06e9aa59c195..1544b19bb7dcf11393179926f0986ce1f8c4172c 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -745,7 +745,8 @@ class WebContentsViewAura::WindowObserver
WebContentsViewAura::WebContentsViewAura(
WebContentsImpl* web_contents,
WebContentsViewDelegate* delegate)
- : web_contents_(web_contents),
+ : WebContentsObserver(web_contents),
+ web_contents_(web_contents),
delegate_(delegate),
current_drag_op_(blink::WebDragOperationNone),
drag_dest_delegate_(NULL),
@@ -1646,6 +1647,12 @@ int WebContentsViewAura::OnPerformDrop(const ui::DropTargetEvent& event) {
return ConvertFromWeb(current_drag_op_);
}
+void WebContentsViewAura::RenderProcessGone(base::TerminationStatus status) {
+#if defined(OS_WIN)
+ UpdateLegacyHwndVisibility();
+#endif
+}
+
void WebContentsViewAura::OnWindowVisibilityChanged(aura::Window* window,
bool visible) {
// Ignore any visibility changes in the hierarchy below.
@@ -1678,9 +1685,18 @@ void WebContentsViewAura::UpdateWebContentsVisibility(bool visible) {
}
#if defined(OS_WIN)
+ UpdateLegacyHwndVisibility();
+#endif
+}
+
+#if defined(OS_WIN)
+void WebContentsViewAura::UpdateLegacyHwndVisibility() {
if (!legacy_hwnd_)
return;
+ bool visible = (window_->IsVisible() &&
+ web_contents_->GetRenderWidgetHostView());
+
if (visible && GetNativeView() && GetNativeView()->GetHost()) {
legacy_hwnd_->UpdateParent(
GetNativeView()->GetHost()->GetAcceleratedWidget());
@@ -1692,10 +1708,8 @@ void WebContentsViewAura::UpdateWebContentsVisibility(bool visible) {
legacy_hwnd_->UpdateParent(ui::GetHiddenWindow());
legacy_hwnd_->Hide();
}
-#endif
}
-#if defined(OS_WIN)
gfx::NativeViewAccessible
WebContentsViewAura::GetNativeViewAccessible() {
BrowserAccessibilityManager* manager =
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698