Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: ui/aura/client/transient_window_client.h

Issue 115453004: Moves management of transients out of Window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unneeded parens Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/client/transient_window_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/client/transient_window_client.h
diff --git a/ui/aura/client/transient_window_client.h b/ui/aura/client/transient_window_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..90112ed73617f9f34ba00eead48e09c1d62d3029
--- /dev/null
+++ b/ui/aura/client/transient_window_client.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2014 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_TRANSIENT_WINDOW_CLIENT_H_
+#define UI_AURA_CLIENT_TRANSIENT_WINDOW_CLIENT_H_
+
+#include "base/basictypes.h"
+#include "ui/aura/aura_export.h"
+
+namespace aura {
+
+class Window;
+
+namespace client {
+
+// TransientWindowClient is used to add or remove transient windows. Transient
+// children get the following behavior:
+// . The transient parent destroys any transient children when it is
+// destroyed. This means a transient child is destroyed if either its parent
+// or transient parent is destroyed.
+// . If a transient child and its transient parent share the same parent, then
+// transient children are always ordered above the transient parent.
+// Transient windows are typically used for popups and menus.
+// TODO(sky): nuke this class and replace with calls to TransientWindowManager.
+// This is temporary until we start moving to ui/wm.
+class AURA_EXPORT TransientWindowClient {
+ public:
+ virtual void AddTransientChild(Window* parent, Window* child) = 0;
+ virtual void RemoveTransientChild(Window* parent, Window* child) = 0;
+ virtual Window* GetTransientParent(Window* window) = 0;
+ virtual const Window* GetTransientParent(const Window* window) = 0;
+
+ protected:
+ virtual ~TransientWindowClient() {}
+};
+
+// Sets/gets the TransientWindowClient. This does *not* take ownership of
+// |client|. It is assumed the caller will invoke SetTransientWindowClient(NULL)
+// before deleting |client|.
+AURA_EXPORT void SetTransientWindowClient(TransientWindowClient* client);
+AURA_EXPORT TransientWindowClient* GetTransientWindowClient();
+
+} // namespace client
+} // namespace aura
+
+#endif // UI_AURA_CLIENT_TRANSIENT_WINDOW_CLIENT_H_
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/client/transient_window_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698