diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 19:32:06 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-29 19:32:06 +0000 |
commit | 81585f3fa532dbe0355991b56c8d5bbb7b9ae321 (patch) | |
tree | 69f78267fc35600fec11a9533fe5d7af18ed42dc /aura/desktop_host_win.cc | |
parent | f1aa3566cb4b397eb4f567e8b88610d81de17566 (diff) | |
download | chromium_src-81585f3fa532dbe0355991b56c8d5bbb7b9ae321.zip chromium_src-81585f3fa532dbe0355991b56c8d5bbb7b9ae321.tar.gz chromium_src-81585f3fa532dbe0355991b56c8d5bbb7b9ae321.tar.bz2 |
Shell of implementation for embedded windows. At this point this is
just a proof of concept. Next step is going to be pulling code from
the window manager into this. Desktop will likely be renamed to
WindowManager.
At this point just make sure you think I'm not going off into the
weeds.
BUG=none
TEST=none
R=derat@chromium.org
Review URL: http://codereview.chromium.org/7534002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'aura/desktop_host_win.cc')
-rw-r--r-- | aura/desktop_host_win.cc | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/aura/desktop_host_win.cc b/aura/desktop_host_win.cc new file mode 100644 index 0000000..70489ea --- /dev/null +++ b/aura/desktop_host_win.cc @@ -0,0 +1,54 @@ +// 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 "aura/desktop_host_win.h" + +#include "aura/desktop.h" +#include "base/message_loop.h" + +namespace aura { + +// static +DesktopHost* DesktopHost::Create(const gfx::Rect& bounds) { + return new DesktopHostWin(bounds); +} + +DesktopHostWin::DesktopHostWin(const gfx::Rect& bounds) : desktop_(NULL) { + Init(NULL, bounds); +} + +DesktopHostWin::~DesktopHostWin() { + DestroyWindow(hwnd()); +} + +void DesktopHostWin::SetDesktop(Desktop* desktop) { + desktop_ = desktop; +} + +gfx::AcceleratedWidget DesktopHostWin::GetAcceleratedWidget() { + return hwnd(); +} + +void DesktopHostWin::Show() { + ShowWindow(hwnd(), SW_SHOWNORMAL); +} + +gfx::Size DesktopHostWin::GetSize() { + RECT r; + GetClientRect(hwnd(), &r); + return gfx::Rect(r).size(); +} + +void DesktopHostWin::OnClose() { + // TODO: this obviously shouldn't be here. + MessageLoopForUI::current()->Quit(); +} + +void DesktopHostWin::OnPaint(HDC dc) { + if (desktop_) + desktop_->Draw(); + ValidateRect(hwnd(), NULL); +} + +} // namespace aura |