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

Unified Diff: aura/desktop.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: Created 9 years, 5 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
Index: aura/desktop.cc
diff --git a/aura/desktop.cc b/aura/desktop.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fdf19773f03db6e921d3952a26f4f1668d55f0ea
--- /dev/null
+++ b/aura/desktop.cc
@@ -0,0 +1,46 @@
+// 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 <algorithm>
+
+#include "aura/window.h"
+#include "base/logging.h"
+#include "ui/gfx/compositor/compositor.h"
+
+namespace aura {
+
+Desktop::Desktop(gfx::AcceleratedWidget widget, const gfx::Size& size)
+ : compositor_(ui::Compositor::Create(widget, size)) {
+ DCHECK(compositor_.get());
+}
+
+Desktop::~Desktop() {
+}
+
+void Desktop::Draw() {
+ // First pass updates the layer bitmaps.
+ for (Windows::iterator i = windows_.begin(); i != windows_.end(); ++i)
Daniel Erat 2011/07/28 23:00:37 nit: i think that i've more commonly seen 'it' use
+ (*i)->UpdateLayerCanvas();
+
+ // Second pass renders the layers.
+ compositor_->NotifyStart();
+ for (Windows::iterator i = windows_.begin(); i != windows_.end(); ++i)
+ (*i)->Draw();
+ compositor_->NotifyEnd();
+}
+
+void Desktop::Show(Window* window) {
+ DCHECK(std::find(windows_.begin(), windows_.end(), window) == windows_.end());
+ windows_.push_back(window);
+}
+
+void Desktop::Hide(Window* window) {
+ Windows::iterator i = std::find(windows_.begin(), windows_.end(), window);
+ DCHECK(i != windows_.end());
+ windows_.erase(i);
+}
+
+} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698