diff options
Diffstat (limited to 'ui/aura/test_desktop_delegate.cc')
-rw-r--r-- | ui/aura/test_desktop_delegate.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ui/aura/test_desktop_delegate.cc b/ui/aura/test_desktop_delegate.cc new file mode 100644 index 0000000..73df23f --- /dev/null +++ b/ui/aura/test_desktop_delegate.cc @@ -0,0 +1,32 @@ +// 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/test_desktop_delegate.h" + +#include "ui/aura/desktop.h" + +namespace aura { + +TestDesktopDelegate::TestDesktopDelegate() + : default_container_(new ToplevelWindowContainer) { + Desktop::GetInstance()->SetDelegate(this); + default_container_->Init(); + default_container_->SetBounds( + gfx::Rect(gfx::Point(), Desktop::GetInstance()->GetSize())); + Desktop::GetInstance()->window()->AddChild(default_container_.get()); + default_container_->Show(); +} + +TestDesktopDelegate::~TestDesktopDelegate() { +} + +void TestDesktopDelegate::AddChildToDefaultParent(Window* window) { + default_container_->AddChild(window); +} + +Window* TestDesktopDelegate::GetTopmostWindowToActivate(Window* ignore) const { + return default_container_->GetTopmostWindowToActivate(ignore); +} + +} // namespace aura |