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

Unified Diff: ash/common/wm/container_finder.cc

Issue 2287583002: mash: Fix crash when closing system tray menu (Closed)
Patch Set: Created 4 years, 4 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
Index: ash/common/wm/container_finder.cc
diff --git a/ash/common/wm/container_finder.cc b/ash/common/wm/container_finder.cc
index 6eb05a38a211beb68dfd1ecafc2932749f1e00c2..1d954287525f490dbe6166ffbbe84a3ee8f4fbfa 100644
--- a/ash/common/wm/container_finder.cc
+++ b/ash/common/wm/container_finder.cc
@@ -60,10 +60,11 @@ WmWindow* GetContainerFromAlwaysOnTopController(WmWindow* root,
} // namespace
WmWindow* GetContainerForWindow(WmWindow* window) {
- WmWindow* container = window->GetParent();
- while (container && container->GetType() != ui::wm::WINDOW_TYPE_UNKNOWN)
- container = container->GetParent();
- return container;
+ WmWindow* parent = window->GetParent();
+ // The first parent with an explicit shell window ID is the container.
+ while (parent && parent->GetShellWindowId() == kShellWindowId_Invalid)
+ parent = parent->GetParent();
+ return parent;
}
WmWindow* GetDefaultParent(WmWindow* context,

Powered by Google App Engine
This is Rietveld 408576698