Index: ui/wm/core/window_util.h |
diff --git a/ui/wm/core/window_util.h b/ui/wm/core/window_util.h |
index 1bd9cb8b4969ff5a4ca4700dd743449bb54a8a76..2b48b06e1fa55be11b3508beb8231d3deade20cd 100644 |
--- a/ui/wm/core/window_util.h |
+++ b/ui/wm/core/window_util.h |
@@ -6,8 +6,10 @@ |
#define UI_WM_CORE_WINDOW_UTIL_H_ |
#include <memory> |
+#include <utility> |
#include <vector> |
+#include "base/callback_forward.h" |
#include "base/compiler_specific.h" |
#include "ui/wm/wm_export.h" |
@@ -46,6 +48,17 @@ WM_EXPORT aura::Window* GetToplevelWindow(aura::Window* window); |
WM_EXPORT std::unique_ptr<ui::LayerTreeOwner> RecreateLayers( |
ui::LayerOwner* root); |
+using MapLayerFunc = |
+ base::Callback<std::unique_ptr<ui::Layer>(ui::LayerOwner*)>; |
sky
2017/05/17 14:48:30
RepeatingCallback.
Muyuan
2017/05/17 19:25:35
Done.
|
+ |
+// Maps |map_func| over each layer of the layer tree and returns a copy of the |
+// layer tree. The recursion stops at the level when |map_func| returns nullptr |
+// on the owner's layer. MapLayers might return nullptr when |map_func| returns |
+// nullptr on the root layer's owner. |
+WM_EXPORT std::unique_ptr<ui::LayerTreeOwner> MapLayers( |
sky
2017/05/17 14:48:30
Add test coverage of this.
How about naming this R
Muyuan
2017/05/17 19:25:35
Done.
|
+ ui::LayerOwner* root, |
+ const MapLayerFunc& map_func); |
+ |
// Returns a layer tree that mirrors |root|. Used for live window previews. If |
// |sync_bounds| is true, the bounds of all mirror layers except the root are |
// synchronized. See |sync_bounds_| in ui::Layer. |