summaryrefslogtreecommitdiffstats
path: root/ui/aura/client/window_tree_client.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-23 20:44:37 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-23 20:44:37 +0000
commite3225e03e88436787f9e215a24ff5e1d70eeeb65 (patch)
tree5fb7d31be1e76201a49e23e86ccf39b1497c52e2 /ui/aura/client/window_tree_client.h
parent9e00f36137ed67399711010ede7c74315237515f (diff)
downloadchromium_src-e3225e03e88436787f9e215a24ff5e1d70eeeb65.zip
chromium_src-e3225e03e88436787f9e215a24ff5e1d70eeeb65.tar.gz
chromium_src-e3225e03e88436787f9e215a24ff5e1d70eeeb65.tar.bz2
Rename StackingClient -> WindowTreeClient
Remove SetDefaultParentForRootWindow from Window, and replace with new utility function ParentWindowForContext in window_tree_client.h This is part of my current campaign to slim down the aura Window types. I will eventually move WindowTreeClient to a new ui/wm component that I plan to create. R=erg@chromium.org http://crbug.com/308844 Review URL: https://codereview.chromium.org/36473003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/client/window_tree_client.h')
-rw-r--r--ui/aura/client/window_tree_client.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/ui/aura/client/window_tree_client.h b/ui/aura/client/window_tree_client.h
new file mode 100644
index 0000000..59cb132
--- /dev/null
+++ b/ui/aura/client/window_tree_client.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_AURA_CLIENT_WINDOW_TREE_CLIENT_H_
+#define UI_AURA_CLIENT_WINDOW_TREE_CLIENT_H_
+
+#include "ui/aura/aura_export.h"
+
+namespace gfx {
+class Rect;
+}
+
+namespace aura {
+class Window;
+namespace client {
+
+// Implementations of this object are used to help locate a default parent for
+// NULL-parented Windows.
+class AURA_EXPORT WindowTreeClient {
+ public:
+ virtual ~WindowTreeClient() {}
+
+ // Called by the Window when it looks for a default parent. Returns the
+ // window that |window| should be added to instead. |context| provides a
+ // Window (generally a RootWindow) that can be used to determine which
+ // desktop type the default parent should be chosen from. NOTE: this may
+ // have side effects. It should only be used when |window| is going to be
+ // immediately added.
+ //
+ // TODO(erg): Remove |context|, and maybe after oshima's patch lands,
+ // |bounds|.
+ virtual Window* GetDefaultParent(
+ Window* context,
+ Window* window,
+ const gfx::Rect& bounds) = 0;
+};
+
+// Set/Get a window tree client for the RootWindow containing |window|. |window|
+// must not be NULL.
+AURA_EXPORT void SetWindowTreeClient(Window* window,
+ WindowTreeClient* window_tree_client);
+WindowTreeClient* GetWindowTreeClient(Window* window);
+
+// Adds |window| to an appropriate parent by consulting an implementation of
+// WindowTreeClient attached at the root Window containing |context|. The final
+// location may be a window hierarchy other than the one supplied via
+// |context|, which must not be NULL. |screen_bounds| may be empty.
+AURA_EXPORT void ParentWindowWithContext(Window* window,
+ Window* context,
+ const gfx::Rect& screen_bounds);
+
+} // namespace client
+} // namespace aura
+
+#endif // UI_AURA_CLIENT_WINDOW_TREE_CLIENT_H_