OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/desktop_host_win.h" | 5 #include "ui/aura/desktop_host_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 } // namespace | 102 } // namespace |
103 | 103 |
104 // static | 104 // static |
105 DesktopHost* DesktopHost::Create(const gfx::Rect& bounds) { | 105 DesktopHost* DesktopHost::Create(const gfx::Rect& bounds) { |
106 return new DesktopHostWin(bounds); | 106 return new DesktopHostWin(bounds); |
107 } | 107 } |
108 | 108 |
| 109 // static |
| 110 gfx::Size DesktopHost::GetNativeDisplaySize() { |
| 111 return gfx::Size(GetSystemMetrics(SM_CXSCREEN), |
| 112 GetSystemMetrics(SM_CYSCREEN)); |
| 113 } |
| 114 |
109 DesktopHostWin::DesktopHostWin(const gfx::Rect& bounds) : desktop_(NULL) { | 115 DesktopHostWin::DesktopHostWin(const gfx::Rect& bounds) : desktop_(NULL) { |
110 Init(NULL, bounds); | 116 Init(NULL, bounds); |
111 SetWindowText(hwnd(), L"aura::Desktop!"); | 117 SetWindowText(hwnd(), L"aura::Desktop!"); |
112 } | 118 } |
113 | 119 |
114 DesktopHostWin::~DesktopHostWin() { | 120 DesktopHostWin::~DesktopHostWin() { |
115 DestroyWindow(hwnd()); | 121 DestroyWindow(hwnd()); |
116 } | 122 } |
117 | 123 |
118 bool DesktopHostWin::Dispatch(const MSG& msg) { | 124 bool DesktopHostWin::Dispatch(const MSG& msg) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void DesktopHostWin::OnPaint(HDC dc) { | 205 void DesktopHostWin::OnPaint(HDC dc) { |
200 desktop_->Draw(); | 206 desktop_->Draw(); |
201 ValidateRect(hwnd(), NULL); | 207 ValidateRect(hwnd(), NULL); |
202 } | 208 } |
203 | 209 |
204 void DesktopHostWin::OnSize(UINT param, const CSize& size) { | 210 void DesktopHostWin::OnSize(UINT param, const CSize& size) { |
205 desktop_->OnHostResized(gfx::Size(size.cx, size.cy)); | 211 desktop_->OnHostResized(gfx::Size(size.cx, size.cy)); |
206 } | 212 } |
207 | 213 |
208 } // namespace aura | 214 } // namespace aura |
OLD | NEW |