OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1096 } | 1096 } |
1097 | 1097 |
1098 const aura::Window::Windows& child_windows = native_view->children(); | 1098 const aura::Window::Windows& child_windows = native_view->children(); |
1099 for (aura::Window::Windows::const_iterator i = child_windows.begin(); | 1099 for (aura::Window::Windows::const_iterator i = child_windows.begin(); |
1100 i != child_windows.end(); ++i) { | 1100 i != child_windows.end(); ++i) { |
1101 GetAllChildWidgets((*i), children); | 1101 GetAllChildWidgets((*i), children); |
1102 } | 1102 } |
1103 } | 1103 } |
1104 | 1104 |
1105 // static | 1105 // static |
1106 void NativeWidgetPrivate::GetAllOwnedWidgets(gfx::NativeView native_view, | 1106 void NativeWidgetPrivate::GetAllOwnedWidgets(gfx::NativeView native_view, |
tapted
2014/10/15 23:59:24
you'll need to update the comment in widget.h
htt
sashab
2014/10/20 03:03:00
Done to just remove 'non-child'. Didn't think I ne
| |
1107 Widget::Widgets* owned) { | 1107 Widget::Widgets* owned) { |
1108 // Add all owned widgets. | |
1108 const aura::Window::Windows& transient_children = | 1109 const aura::Window::Windows& transient_children = |
1109 wm::GetTransientChildren(native_view); | 1110 wm::GetTransientChildren(native_view); |
1110 for (aura::Window::Windows::const_iterator i = transient_children.begin(); | 1111 for (aura::Window::Windows::const_iterator i = transient_children.begin(); |
1111 i != transient_children.end(); ++i) { | 1112 i != transient_children.end(); ++i) { |
1112 NativeWidgetPrivate* native_widget = static_cast<NativeWidgetPrivate*>( | 1113 NativeWidgetPrivate* native_widget = static_cast<NativeWidgetPrivate*>( |
1113 GetNativeWidgetForNativeView(*i)); | 1114 GetNativeWidgetForNativeView(*i)); |
1114 if (native_widget && native_widget->GetWidget()) | 1115 if (native_widget && native_widget->GetWidget()) |
1115 owned->insert(native_widget->GetWidget()); | 1116 owned->insert(native_widget->GetWidget()); |
1116 GetAllOwnedWidgets((*i), owned); | 1117 GetAllOwnedWidgets((*i), owned); |
1117 } | 1118 } |
1119 | |
1120 // Add all owned windows. | |
tapted
2014/10/15 23:59:24
owned windows -> child windows
sashab
2014/10/20 03:03:00
Done.
| |
1121 const aura::Window::Windows& child_windows = native_view->children(); | |
1122 for (aura::Window::Windows::const_iterator i = child_windows.begin(); | |
tapted
2014/10/15 23:59:24
might as well start using C++11. Pretty sure this
sashab
2014/10/20 03:03:00
Done. Git cl format wants to change "x->y()" to "x
| |
1123 i != child_windows.end(); | |
1124 ++i) { | |
1125 GetAllChildWidgets((*i), owned); | |
1126 } | |
1118 } | 1127 } |
1119 | 1128 |
1120 // static | 1129 // static |
1121 void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view, | 1130 void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view, |
1122 gfx::NativeView new_parent) { | 1131 gfx::NativeView new_parent) { |
1123 DCHECK(native_view != new_parent); | 1132 DCHECK(native_view != new_parent); |
1124 | 1133 |
1125 gfx::NativeView previous_parent = native_view->parent(); | 1134 gfx::NativeView previous_parent = native_view->parent(); |
1126 if (previous_parent == new_parent) | 1135 if (previous_parent == new_parent) |
1127 return; | 1136 return; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1175 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1184 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
1176 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1185 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
1177 return gfx::FontList(gfx::Font(caption_font)); | 1186 return gfx::FontList(gfx::Font(caption_font)); |
1178 #else | 1187 #else |
1179 return gfx::FontList(); | 1188 return gfx::FontList(); |
1180 #endif | 1189 #endif |
1181 } | 1190 } |
1182 | 1191 |
1183 } // namespace internal | 1192 } // namespace internal |
1184 } // namespace views | 1193 } // namespace views |
OLD | NEW |