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

Unified Diff: aura/desktop.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.h ('k') | aura/desktop_host.h » ('j') | ui/aura/aura.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: aura/desktop.cc
===================================================================
--- aura/desktop.cc (revision 100961)
+++ aura/desktop.cc (working copy)
@@ -1,88 +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.h"
-
-#include "aura/desktop_host.h"
-#include "aura/root_window.h"
-#include "aura/window.h"
-#include "base/logging.h"
-#include "base/message_loop.h"
-#include "ui/gfx/compositor/compositor.h"
-#include "ui/gfx/compositor/layer.h"
-
-namespace aura {
-
-// static
-Desktop* Desktop::instance_ = NULL;
-
-Desktop::Desktop()
- : host_(aura::DesktopHost::Create(gfx::Rect(200, 200, 1024, 768))),
- ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_(this)) {
- DCHECK(MessageLoopForUI::current())
- << "The UI message loop must be initialized first.";
- compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(),
- host_->GetSize());
- host_->SetDesktop(this);
- DCHECK(compositor_.get());
- window_.reset(new internal::RootWindow);
-}
-
-Desktop::~Desktop() {
- if (instance_ == this)
- instance_ = NULL;
-}
-
-void Desktop::Show() {
- host_->Show();
-}
-
-void Desktop::SetSize(const gfx::Size& size) {
- host_->SetSize(size);
-}
-
-void Desktop::Run() {
- Show();
- MessageLoopForUI::current()->Run(host_.get());
-}
-
-void Desktop::Draw() {
- // Second pass renders the layers.
- const bool force_clear = false;
- compositor_->NotifyStart(force_clear);
- window_->layer()->DrawTree();
- compositor_->NotifyEnd();
-}
-
-bool Desktop::OnMouseEvent(const MouseEvent& event) {
- return window_->HandleMouseEvent(event);
-}
-
-bool Desktop::OnKeyEvent(const KeyEvent& event) {
- return window_->HandleKeyEvent(event);
-}
-
-void Desktop::OnHostResized(const gfx::Size& size) {
- gfx::Rect bounds(window_->bounds().origin(), size);
- window_->SetBounds(bounds, 0);
- compositor_->WidgetSizeChanged(size);
-}
-
-void Desktop::ScheduleCompositorPaint() {
- if (schedule_paint_.empty()) {
- MessageLoop::current()->PostTask(FROM_HERE,
- schedule_paint_.NewRunnableMethod(&Desktop::Draw));
- }
-}
-
-// static
-Desktop* Desktop::GetInstance() {
- if (!instance_) {
- instance_ = new Desktop;
- instance_->window_->Init();
- }
- return instance_;
-}
-
-} // namespace aura
« no previous file with comments | « aura/desktop.h ('k') | aura/desktop_host.h » ('j') | ui/aura/aura.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698