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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 588113002: Change Widget::GetAllOwnedWidgets to return child widgets as well (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aid_resilient_to_uninstall_and_profile_changes
Patch Set: Minor fix Created 6 years, 2 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 | « ui/views/accessibility/native_view_accessibility_win.cc ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 28893559798560c5f228f0e2d2dca31cf1cd7316..a37ad7303d3edf36130a4518a6e6ff94c84b0a88 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -1107,16 +1107,18 @@ void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view,
// static
void NativeWidgetPrivate::GetAllOwnedWidgets(gfx::NativeView native_view,
Widget::Widgets* owned) {
- const aura::Window::Windows& transient_children =
- wm::GetTransientChildren(native_view);
- for (aura::Window::Windows::const_iterator i = transient_children.begin();
- i != transient_children.end(); ++i) {
+ // Add all owned widgets.
+ for (aura::Window* transient_child : wm::GetTransientChildren(native_view)) {
NativeWidgetPrivate* native_widget = static_cast<NativeWidgetPrivate*>(
- GetNativeWidgetForNativeView(*i));
+ GetNativeWidgetForNativeView(transient_child));
if (native_widget && native_widget->GetWidget())
owned->insert(native_widget->GetWidget());
- GetAllOwnedWidgets((*i), owned);
+ GetAllOwnedWidgets(transient_child, owned);
}
+
+ // Add all child windows.
+ for (aura::Window* child : native_view->children())
+ GetAllChildWidgets(child, owned);
}
// static
« no previous file with comments | « ui/views/accessibility/native_view_accessibility_win.cc ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698