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

Side by Side Diff: aura/desktop.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « aura/demo/demo_main.cc ('k') | aura/desktop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef AURA_DESKTOP_H_ 5 #ifndef AURA_DESKTOP_H_
6 #define AURA_DESKTOP_H_ 6 #define AURA_DESKTOP_H_
7 #pragma once 7 #pragma once
8 8
9 #include "aura/window.h" 9 #include "aura/window.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 class Size; 15 class Size;
16 } 16 }
17 17
18 namespace ui { 18 namespace ui {
19 class Compositor; 19 class Compositor;
20 } 20 }
21 21
22 namespace aura { 22 namespace aura {
23 23
24 class DesktopHost;
24 class MouseEvent; 25 class MouseEvent;
25 class Window; 26 class Window;
26 27
27 // Desktop is responsible for hosting a set of windows. 28 // Desktop is responsible for hosting a set of windows.
28 class Desktop { 29 class Desktop {
29 public: 30 public:
30 Desktop(gfx::AcceleratedWidget widget, const gfx::Size& size); 31 Desktop();
31 ~Desktop(); 32 ~Desktop();
32 33
34 // Shows the desktop host and runs an event loop for it.
35 void Run();
36
33 // Draws the necessary set of windows. 37 // Draws the necessary set of windows.
34 void Draw(); 38 void Draw();
35 39
36 // Handles a mouse event. Returns true if handled. 40 // Handles a mouse event. Returns true if handled.
37 bool OnMouseEvent(const MouseEvent& event); 41 bool OnMouseEvent(const MouseEvent& event);
38 42
39 // Compositor we're drawing to. 43 // Compositor we're drawing to.
40 ui::Compositor* compositor() { return compositor_.get(); } 44 ui::Compositor* compositor() { return compositor_.get(); }
41 45
42 Window* window() { return window_.get(); } 46 Window* window() { return window_.get(); }
43 47
48 static Desktop* GetInstance();
49
44 private: 50 private:
45 scoped_refptr<ui::Compositor> compositor_; 51 scoped_refptr<ui::Compositor> compositor_;
46 52
47 scoped_ptr<Window> window_; 53 scoped_ptr<Window> window_;
48 54
55 DesktopHost* host_;
56
57 static Desktop* instance_;
58
49 DISALLOW_COPY_AND_ASSIGN(Desktop); 59 DISALLOW_COPY_AND_ASSIGN(Desktop);
50 }; 60 };
51 61
52 } // namespace aura 62 } // namespace aura
53 63
54 #endif // AURA_DESKTOP_H_ 64 #endif // AURA_DESKTOP_H_
OLDNEW
« no previous file with comments | « aura/demo/demo_main.cc ('k') | aura/desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698