OLD | NEW |
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 #include "ui/aura/desktop.h" | 5 #include "ui/aura/desktop.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "ui/aura/desktop_delegate.h" | 10 #include "ui/aura/desktop_delegate.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // static | 26 // static |
27 ui::Compositor*(*Desktop::compositor_factory_)() = NULL; | 27 ui::Compositor*(*Desktop::compositor_factory_)() = NULL; |
28 | 28 |
29 Desktop::Desktop() | 29 Desktop::Desktop() |
30 : delegate_(NULL), | 30 : delegate_(NULL), |
31 host_(aura::DesktopHost::Create(gfx::Rect(200, 200, 1280, 1024))), | 31 host_(aura::DesktopHost::Create(gfx::Rect(200, 200, 1280, 1024))), |
32 ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_factory_(this)), | 32 ALLOW_THIS_IN_INITIALIZER_LIST(schedule_paint_factory_(this)), |
33 active_window_(NULL), | 33 active_window_(NULL), |
34 in_destructor_(false) { | 34 in_destructor_(false) { |
35 if (compositor_factory_) { | 35 if (compositor_factory_) { |
36 compositor_ = (*Desktop::compositor_factory())(); | 36 compositor_ = (*Desktop::compositor_factory())(this); |
37 } else { | 37 } else { |
38 compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(), | 38 compositor_ = ui::Compositor::Create(this, host_->GetAcceleratedWidget(), |
39 host_->GetSize()); | 39 host_->GetSize()); |
40 } | 40 } |
41 gfx::Screen::SetInstance(new internal::ScreenAura); | 41 gfx::Screen::SetInstance(new internal::ScreenAura); |
42 host_->SetDesktop(this); | 42 host_->SetDesktop(this); |
43 DCHECK(compositor_.get()); | 43 DCHECK(compositor_.get()); |
44 window_.reset(new internal::RootWindow); | 44 window_.reset(new internal::RootWindow); |
45 } | 45 } |
46 | 46 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // static | 167 // static |
168 Desktop* Desktop::GetInstance() { | 168 Desktop* Desktop::GetInstance() { |
169 if (!instance_) { | 169 if (!instance_) { |
170 instance_ = new Desktop; | 170 instance_ = new Desktop; |
171 instance_->Init(); | 171 instance_->Init(); |
172 } | 172 } |
173 return instance_; | 173 return instance_; |
174 } | 174 } |
175 | 175 |
176 } // namespace aura | 176 } // namespace aura |
OLD | NEW |