OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "apps/shell/browser/shell_desktop_controller.h" | 5 #include "apps/shell/browser/shell_desktop_controller.h" |
6 | 6 |
7 #include "apps/shell/browser/shell_app_window_controller.h" | 7 #include "apps/shell/browser/shell_app_window_controller.h" |
8 #include "content/public/browser/context_factory.h" | 8 #include "content/public/browser/context_factory.h" |
9 #include "ui/aura/client/cursor_client.h" | 9 #include "ui/aura/client/cursor_client.h" |
10 #include "ui/aura/client/default_capture_client.h" | 10 #include "ui/aura/client/default_capture_client.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 217 |
218 void ShellDesktopController::OnHostCloseRequested( | 218 void ShellDesktopController::OnHostCloseRequested( |
219 const aura::WindowTreeHost* host) { | 219 const aura::WindowTreeHost* host) { |
220 DCHECK_EQ(host_.get(), host); | 220 DCHECK_EQ(host_.get(), host); |
221 CloseAppWindows(); | 221 CloseAppWindows(); |
222 base::MessageLoop::current()->PostTask(FROM_HERE, | 222 base::MessageLoop::current()->PostTask(FROM_HERE, |
223 base::MessageLoop::QuitClosure()); | 223 base::MessageLoop::QuitClosure()); |
224 } | 224 } |
225 | 225 |
226 void ShellDesktopController::CreateRootWindow() { | 226 void ShellDesktopController::CreateRootWindow() { |
227 test_screen_.reset(aura::TestScreen::Create()); | |
228 // TODO(jamescook): Replace this with a real Screen implementation. | |
229 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); | |
230 // TODO(mukai): Set up input method. | |
231 | |
232 // Set up basic pieces of ui::wm. | 227 // Set up basic pieces of ui::wm. |
233 gfx::Size size = GetPrimaryDisplaySize(); | 228 gfx::Size size = GetPrimaryDisplaySize(); |
234 if (size.IsEmpty()) | 229 if (size.IsEmpty()) |
235 size = gfx::Size(1366, 768); | 230 size = gfx::Size(1366, 768); |
236 | 231 |
| 232 test_screen_.reset(aura::TestScreen::Create(size)); |
| 233 // TODO(jamescook): Replace this with a real Screen implementation. |
| 234 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); |
| 235 // TODO(mukai): Set up input method. |
| 236 |
237 host_.reset(aura::WindowTreeHost::Create(gfx::Rect(size))); | 237 host_.reset(aura::WindowTreeHost::Create(gfx::Rect(size))); |
238 host_->InitHost(); | 238 host_->InitHost(); |
239 aura::client::SetWindowTreeClient(host_->window(), this); | 239 aura::client::SetWindowTreeClient(host_->window(), this); |
240 root_window_event_filter_.reset(new wm::CompoundEventFilter); | 240 root_window_event_filter_.reset(new wm::CompoundEventFilter); |
241 host_->window()->AddPreTargetHandler(root_window_event_filter_.get()); | 241 host_->window()->AddPreTargetHandler(root_window_event_filter_.get()); |
242 InitWindowManager(); | 242 InitWindowManager(); |
243 | 243 |
244 host_->AddObserver(this); | 244 host_->AddObserver(this); |
245 | 245 |
246 // Ensure the X window gets mapped. | 246 // Ensure the X window gets mapped. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 if (displays.empty()) | 316 if (displays.empty()) |
317 return gfx::Size(); | 317 return gfx::Size(); |
318 const ui::DisplayMode* mode = displays[0].display->current_mode(); | 318 const ui::DisplayMode* mode = displays[0].display->current_mode(); |
319 return mode ? mode->size() : gfx::Size(); | 319 return mode ? mode->size() : gfx::Size(); |
320 #else | 320 #else |
321 return gfx::Size(); | 321 return gfx::Size(); |
322 #endif | 322 #endif |
323 } | 323 } |
324 | 324 |
325 } // namespace apps | 325 } // namespace apps |
OLD | NEW |