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

Unified Diff: aura/desktop_host_win.cc

Issue 7886042: Move Aura to UI subdir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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/event.h » ('j') | ui/aura/aura.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: aura/desktop_host_win.cc
===================================================================
--- aura/desktop_host_win.cc (revision 100961)
+++ aura/desktop_host_win.cc (working copy)
@@ -1,96 +0,0 @@
-// 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 "aura/event.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());
-}
-
-bool DesktopHostWin::Dispatch(const MSG& msg) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- return true;
-}
-
-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::SetSize(const gfx::Size& size) {
- SetWindowPos(
- hwnd(),
- NULL,
- 0,
- 0,
- size.width(),
- size.height(),
- SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOREPOSITION);
-}
-
-void DesktopHostWin::OnClose() {
- // TODO: this obviously shouldn't be here.
- MessageLoopForUI::current()->Quit();
-}
-
-LRESULT DesktopHostWin::OnKeyEvent(UINT message,
- WPARAM w_param,
- LPARAM l_param) {
- MSG msg = { hwnd(), message, w_param, l_param };
- SetMsgHandled(desktop_->OnKeyEvent(KeyEvent(msg)));
- return 0;
-}
-
-LRESULT DesktopHostWin::OnMouseRange(UINT message,
- WPARAM w_param,
- LPARAM l_param) {
- MSG msg = { hwnd(), message, w_param, l_param, 0,
- { GET_X_LPARAM(l_param), GET_Y_LPARAM(l_param) } };
- MouseEvent event(msg);
- bool handled = false;
- if (!(event.flags() & ui::EF_IS_NON_CLIENT))
- handled = desktop_->OnMouseEvent(event);
- SetMsgHandled(handled);
- return 0;
-}
-
-void DesktopHostWin::OnPaint(HDC dc) {
- desktop_->Draw();
- ValidateRect(hwnd(), NULL);
-}
-
-void DesktopHostWin::OnSize(UINT param, const CSize& size) {
- desktop_->OnHostResized(gfx::Size(size.cx, size.cy));
-}
-
-} // namespace aura
« no previous file with comments | « aura/desktop_host_win.h ('k') | aura/event.h » ('j') | ui/aura/aura.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698