summaryrefslogtreecommitdiffstats
path: root/ui/aura/client
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-14 06:02:34 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-14 06:02:34 +0000
commitda56a47ab4279016cd690e576bee1d81d414aac5 (patch)
treef77bb17fa1c452d39c8898d2e2ad0c055236630d /ui/aura/client
parentae80a8856c70ea6d58bb7f174a518c91ccedaca2 (diff)
downloadchromium_src-da56a47ab4279016cd690e576bee1d81d414aac5.zip
chromium_src-da56a47ab4279016cd690e576bee1d81d414aac5.tar.gz
chromium_src-da56a47ab4279016cd690e576bee1d81d414aac5.tar.bz2
Store StackingClient on RootWindow in a property.
BUG=none TEST=existing unit tests. Review URL: http://codereview.chromium.org/8926008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/client')
-rw-r--r--ui/aura/client/aura_constants.cc1
-rw-r--r--ui/aura/client/aura_constants.h4
-rw-r--r--ui/aura/client/stacking_client.cc24
-rw-r--r--ui/aura/client/stacking_client.h7
4 files changed, 35 insertions, 1 deletions
diff --git a/ui/aura/client/aura_constants.cc b/ui/aura/client/aura_constants.cc
index c1d0d6e..c39dd15 100644
--- a/ui/aura/client/aura_constants.cc
+++ b/ui/aura/client/aura_constants.cc
@@ -16,6 +16,7 @@ const char kRootWindowDragDropClientKey[] = "RootWindowDragDropClient";
const char kRootWindowTooltipClientKey[] = "RootWindowTooltipClient";
const char kRootWindowActiveWindow[] = "RootWindowActiveWindow";
const char kRootWindowActivationClient[] = "RootWindowActivationClient";
+const char kRootWindowStackingClient[] = "RootWindowStackingClient";
const char kShadowTypeKey[] = "ShadowType";
const char kShowStateKey[] = "ShowState";
const char kTooltipTextKey[] = "TooltipText";
diff --git a/ui/aura/client/aura_constants.h b/ui/aura/client/aura_constants.h
index f5f2920..191c7ad 100644
--- a/ui/aura/client/aura_constants.h
+++ b/ui/aura/client/aura_constants.h
@@ -46,6 +46,10 @@ AURA_EXPORT extern const char kRootWindowActiveWindow[];
// the value is |aura::ActivationClient*|.
AURA_EXPORT extern const char kRootWindowActivationClient[];
+// A property key to store a client that handles window stacking. The type of
+// the value is |aura::StackingClient*|.
+AURA_EXPORT extern const char kRootWindowStackingClient[];
+
// A property key for a value from aura::ShadowType describing the drop shadow
// that should be displayed under the window. If unset, no shadow is displayed.
AURA_EXPORT extern const char kShadowTypeKey[];
diff --git a/ui/aura/client/stacking_client.cc b/ui/aura/client/stacking_client.cc
new file mode 100644
index 0000000..56f96e6
--- /dev/null
+++ b/ui/aura/client/stacking_client.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2011 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.
+
+#include "ui/aura/client/stacking_client.h"
+
+#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/root_window.h"
+
+namespace aura {
+
+// static
+void StackingClient::SetStackingClient(StackingClient* stacking_client) {
+ RootWindow::GetInstance()->SetProperty(kRootWindowStackingClient,
+ stacking_client);
+}
+
+// static
+StackingClient* StackingClient::GetStackingClient() {
+ return reinterpret_cast<StackingClient*>(
+ RootWindow::GetInstance()->GetProperty(kRootWindowStackingClient));
+}
+
+} // namespace aura
diff --git a/ui/aura/client/stacking_client.h b/ui/aura/client/stacking_client.h
index 6e89636..60712e7 100644
--- a/ui/aura/client/stacking_client.h
+++ b/ui/aura/client/stacking_client.h
@@ -15,12 +15,17 @@ class Window;
// An interface implemented by an object that stacks windows.
class AURA_EXPORT StackingClient {
public:
- virtual ~StackingClient() {}
+ // Sets/Gets the StackingClient for the RootWindow.
+ static void SetStackingClient(StackingClient* stacking_client);
+ static StackingClient* GetStackingClient();
// Called by the Window when its parent is set to NULL. The delegate is given
// an opportunity to inspect the window and add it to a default parent window
// of its choosing.
virtual void AddChildToDefaultParent(Window* window) = 0;
+
+ protected:
+ virtual ~StackingClient() {}
};
} // namespace aura