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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « aura/desktop_host_win.h ('k') | aura/window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "aura/desktop_host_win.h"
6
7 #include "aura/desktop.h"
8 #include "base/message_loop.h"
9
10 namespace aura {
11
12 // static
13 DesktopHost* DesktopHost::Create(const gfx::Rect& bounds) {
14 return new DesktopHostWin(bounds);
15 }
16
17 DesktopHostWin::DesktopHostWin(const gfx::Rect& bounds) : desktop_(NULL) {
18 Init(NULL, bounds);
19 }
20
21 DesktopHostWin::~DesktopHostWin() {
22 DestroyWindow(hwnd());
23 }
24
25 void DesktopHostWin::SetDesktop(Desktop* desktop) {
26 desktop_ = desktop;
27 }
28
29 gfx::AcceleratedWidget DesktopHostWin::GetAcceleratedWidget() {
30 return hwnd();
31 }
32
33 void DesktopHostWin::Show() {
34 ShowWindow(hwnd(), SW_SHOWNORMAL);
35 }
36
37 gfx::Size DesktopHostWin::GetSize() {
38 RECT r;
39 GetClientRect(hwnd(), &r);
40 return gfx::Rect(r).size();
41 }
42
43 void DesktopHostWin::OnClose() {
44 // TODO: this obviously shouldn't be here.
45 MessageLoopForUI::current()->Quit();
46 }
47
48 void DesktopHostWin::OnPaint(HDC dc) {
49 if (desktop_)
50 desktop_->Draw();
51 ValidateRect(hwnd(), NULL);
52 }
53
54 } // namespace aura
OLDNEW
« 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