OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef AURA_DESKTOP_H_ |
| 6 #define AURA_DESKTOP_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" |
| 13 #include "ui/gfx/native_widget_types.h" |
| 14 |
| 15 namespace gfx { |
| 16 class Size; |
| 17 } |
| 18 |
| 19 namespace ui { |
| 20 class Compositor; |
| 21 class Window; |
| 22 } |
| 23 |
| 24 namespace aura { |
| 25 |
| 26 // Desktop is responsible for hosting a set of windows. |
| 27 class Desktop { |
| 28 public: |
| 29 Desktop(gfx::AcceleratedWidget widget, const gfx::Size& size); |
| 30 ~Desktop(); |
| 31 |
| 32 // Draws the necessary set of windows. |
| 33 void Draw(); |
| 34 |
| 35 // Compositor we're drawing to. |
| 36 ui::Compositor* compositor() { return compositor_.get(); } |
| 37 |
| 38 private: |
| 39 friend class Window; |
| 40 |
| 41 typedef std::vector<Window*> Windows; |
| 42 |
| 43 // Methods invoked by Window. |
| 44 // TODO: move these into an interface that Window uses to talk to Desktop. |
| 45 void AddWindow(Window* window); |
| 46 void RemoveWindow(Window* window); |
| 47 |
| 48 scoped_refptr<ui::Compositor> compositor_; |
| 49 |
| 50 // The windows. Topmost window is last. |
| 51 std::vector<Window*> windows_; |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(Desktop); |
| 54 }; |
| 55 |
| 56 } // namespace aura |
| 57 |
| 58 #endif // AURA_DESKTOP_H_ |
OLD | NEW |