1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
ash / wm / container_finder.h [blame]
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_WM_CONTAINER_FINDER_H_
#define ASH_WM_CONTAINER_FINDER_H_
#include <vector>
#include "ash/ash_export.h"
#include "base/memory/raw_ptr.h"
namespace aura {
class Window;
}
namespace gfx {
class Rect;
}
namespace ash {
// Returns the first ancestor of |window| that has a known container ID.
ASH_EXPORT aura::Window* GetContainerForWindow(aura::Window* window);
// Returns the parent to add |window| to. This is used to find a proper parent
// for new widget, or a new window. The parent will be picked from a window tree
// in 'root_window' but if there is a better root window candidate that matches
// 'bounds_in_screen', then it will be used instead.
ASH_EXPORT aura::Window* GetDefaultParentForWindow(
aura::Window* window,
aura::Window* root_window,
const gfx::Rect& bounds_in_screen);
// Returns the list of containers that match |container_id| in all root windows.
// If |priority_root| is non-null, the container in |priority_root| is placed at
// the front of the list.
ASH_EXPORT std::vector<raw_ptr<aura::Window, VectorExperimental>>
GetContainersForAllRootWindows(int container_id,
aura::Window* priority_root = nullptr);
// Returns the parent window for power button menu container for the provided
// root_Window.
ASH_EXPORT aura::Window* GetPowerMenuContainerParent(aura::Window* root_window);
} // namespace ash
#endif // ASH_WM_CONTAINER_FINDER_H_