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

Unified Diff: aura/desktop.cc

Issue 7741027: Create a new views_aura_desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « aura/desktop.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.cc
===================================================================
--- aura/desktop.cc (revision 98234)
+++ aura/desktop.cc (working copy)
@@ -4,21 +4,35 @@
#include "aura/desktop.h"
+#include "aura/desktop_host.h"
#include "aura/window.h"
#include "base/logging.h"
+#include "base/message_loop.h"
#include "ui/gfx/compositor/compositor.h"
namespace aura {
-Desktop::Desktop(gfx::AcceleratedWidget widget, const gfx::Size& size)
- : compositor_(ui::Compositor::Create(widget, size)) {
+// static
+Desktop* Desktop::instance_ = NULL;
+
+Desktop::Desktop()
+ : host_(aura::DesktopHost::Create(gfx::Rect(200, 200, 1024, 768))) {
+ compositor_ = ui::Compositor::Create(host_->GetAcceleratedWidget(),
+ host_->GetSize());
+ host_->SetDesktop(this);
DCHECK(compositor_.get());
- window_.reset(new Window(this));
+ window_.reset(new Window(NULL));
}
Desktop::~Desktop() {
}
+void Desktop::Run() {
+ host_->Show();
+ MessageLoop main_message_loop(MessageLoop::TYPE_UI);
+ MessageLoopForUI::current()->Run(host_);
+}
+
void Desktop::Draw() {
// Second pass renders the layers.
compositor_->NotifyStart();
@@ -30,4 +44,13 @@
return window_->OnMouseEvent(event);
}
+// 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/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698