1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_AURA_CLIENT_WINDOW_TREE_CLIENT_H_
6 #define UI_AURA_CLIENT_WINDOW_TREE_CLIENT_H_
8 #include "ui/aura/aura_export.h"
18 // Implementations of this object are used to help locate a default parent for
19 // NULL-parented Windows.
20 class AURA_EXPORT WindowTreeClient
{
22 virtual ~WindowTreeClient() {}
24 // Called by the Window when it looks for a default parent. Returns the
25 // window that |window| should be added to instead. |context| provides a
26 // Window (generally a RootWindow) that can be used to determine which
27 // desktop type the default parent should be chosen from. NOTE: this may
28 // have side effects. It should only be used when |window| is going to be
31 // TODO(erg): Remove |context|, and maybe after oshima's patch lands,
33 virtual Window
* GetDefaultParent(
36 const gfx::Rect
& bounds
) = 0;
39 // Set/Get a window tree client for the RootWindow containing |window|. |window|
41 AURA_EXPORT
void SetWindowTreeClient(Window
* window
,
42 WindowTreeClient
* window_tree_client
);
43 WindowTreeClient
* GetWindowTreeClient(Window
* window
);
45 // Adds |window| to an appropriate parent by consulting an implementation of
46 // WindowTreeClient attached at the root Window containing |context|. The final
47 // location may be a window hierarchy other than the one supplied via
48 // |context|, which must not be NULL. |screen_bounds| may be empty.
49 AURA_EXPORT
void ParentWindowWithContext(Window
* window
,
51 const gfx::Rect
& screen_bounds
);
56 #endif // UI_AURA_CLIENT_WINDOW_TREE_CLIENT_H_