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

Unified Diff: aura/desktop_host_win.cc

Issue 7534002: Shell of implementation for embedded windows. At this point this is (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 9 years, 5 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 | « aura/desktop_host_win.h ('k') | aura/window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: aura/desktop_host_win.cc
diff --git a/aura/desktop_host_win.cc b/aura/desktop_host_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..70489ea902b64da9a3ad4dec284571e40f1266be
--- /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
« no previous file with comments | « aura/desktop_host_win.h ('k') | aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698