| 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 "third_party/skia/include/core/SkColor.h" | 7 #include "third_party/skia/include/core/SkColor.h" |
| 8 #include "ui/aura/env.h" | 8 #include "ui/aura/env.h" |
| 9 #include "ui/aura/test/test_screen.h" | 9 #include "ui/aura/test/test_screen.h" |
| 10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 DestroyRootWindow(); | 68 DestroyRootWindow(); |
| 69 aura::Env::DeleteInstance(); | 69 aura::Env::DeleteInstance(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 aura::WindowTreeHost* ShellDesktopController::GetWindowTreeHost() { | 72 aura::WindowTreeHost* ShellDesktopController::GetWindowTreeHost() { |
| 73 return wm_test_helper_->host(); | 73 return wm_test_helper_->host(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 #if defined(OS_CHROMEOS) && defined(USE_X11) | 76 #if defined(OS_CHROMEOS) && defined(USE_X11) |
| 77 void ShellDesktopController::OnDisplayModeChanged( | 77 void ShellDesktopController::OnDisplayModeChanged( |
| 78 const std::vector<ui::OutputConfigurator::DisplayState>& outputs) OVERRIDE { | 78 const std::vector<ui::OutputConfigurator::DisplayState>& outputs) { |
| 79 gfx::Size size = GetPrimaryDisplaySize(); | 79 gfx::Size size = GetPrimaryDisplaySize(); |
| 80 if (!size.IsEmpty()) | 80 if (!size.IsEmpty()) |
| 81 wm_test_helper_->host()->UpdateRootWindowSize(size); | 81 wm_test_helper_->host()->UpdateRootWindowSize(size); |
| 82 } | 82 } |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 void ShellDesktopController::CreateRootWindow() { | 85 void ShellDesktopController::CreateRootWindow() { |
| 86 test_screen_.reset(aura::TestScreen::Create()); | 86 test_screen_.reset(aura::TestScreen::Create()); |
| 87 // TODO(jamescook): Replace this with a real Screen implementation. | 87 // TODO(jamescook): Replace this with a real Screen implementation. |
| 88 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); | 88 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, test_screen_.get()); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 112 if (states.empty()) | 112 if (states.empty()) |
| 113 return gfx::Size(); | 113 return gfx::Size(); |
| 114 const ui::DisplayMode* mode = states[0].display->current_mode(); | 114 const ui::DisplayMode* mode = states[0].display->current_mode(); |
| 115 return mode ? mode->size() : gfx::Size(); | 115 return mode ? mode->size() : gfx::Size(); |
| 116 #else | 116 #else |
| 117 return gfx::Size(); | 117 return gfx::Size(); |
| 118 #endif | 118 #endif |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace apps | 121 } // namespace apps |
| OLD | NEW |