Chromium Code Reviews| Index: ui/aura/demo/demo_main.cc |
| diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc |
| index be1c68471f7a8877980d84ad926ef604f207bd9e..c6d422f3cb150d0861e39a990702b77146b9b6f3 100644 |
| --- a/ui/aura/demo/demo_main.cc |
| +++ b/ui/aura/demo/demo_main.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/message_loop.h" |
| #include "third_party/skia/include/core/SkXfermode.h" |
| +#include "ui/aura/client/stacking_client.h" |
| #include "ui/aura/event.h" |
| #include "ui/aura/window.h" |
| #include "ui/aura/window_delegate.h" |
| @@ -71,6 +72,27 @@ class DemoWindowDelegate : public aura::WindowDelegate { |
| DISALLOW_COPY_AND_ASSIGN(DemoWindowDelegate); |
| }; |
| +class StackingClientImpl : public aura::client::StackingClient { |
|
Ben Goodger (Google)
2012/03/12 16:35:33
DemoStackingClient (a la DemoWindowDelegate, above
tfarina
2012/03/12 17:36:04
Done.
|
| + public: |
| + explicit StackingClientImpl(aura::RootWindow* root_window) |
| + : root_window_(root_window) { |
| + aura::client::SetStackingClient(this); |
| + } |
| + |
| + virtual ~StackingClientImpl() { |
| + aura::client::SetStackingClient(NULL); |
| + } |
| + |
| + // Overridden from aura::client::StackingClient: |
| + virtual aura::Window* GetDefaultParent(aura::Window* window) OVERRIDE { |
| + return root_window_; |
| + } |
| + |
| + private: |
| + aura::RootWindow* root_window_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(StackingClientImpl); |
| +}; |
| } // namespace |
| @@ -89,6 +111,8 @@ int main(int argc, char** argv) { |
| ui::CompositorTestSupport::Initialize(); |
| scoped_ptr<aura::RootWindow> root_window(new aura::RootWindow); |
| + scoped_ptr<StackingClientImpl> stacking_client(new StackingClientImpl( |
| + root_window.get())); |
| // Create a hierarchy of test windows. |
| DemoWindowDelegate window_delegate1(SK_ColorBLUE); |