Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/accelerators/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 delegate_(delegate), | 187 delegate_(delegate), |
| 188 #if defined(OS_CHROMEOS) | 188 #if defined(OS_CHROMEOS) |
| 189 output_configurator_(new chromeos::OutputConfigurator()), | 189 output_configurator_(new chromeos::OutputConfigurator()), |
| 190 output_configurator_animation_( | 190 output_configurator_animation_( |
| 191 new internal::OutputConfiguratorAnimation()), | 191 new internal::OutputConfiguratorAnimation()), |
| 192 #endif // defined(OS_CHROMEOS) | 192 #endif // defined(OS_CHROMEOS) |
| 193 shelf_(NULL), | 193 shelf_(NULL), |
| 194 panel_layout_manager_(NULL), | 194 panel_layout_manager_(NULL), |
| 195 status_area_widget_(NULL), | 195 status_area_widget_(NULL), |
| 196 browser_context_(NULL) { | 196 browser_context_(NULL) { |
| 197 gfx::Screen::SetInstance(screen_); | 197 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_); |
| 198 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); | |
| 198 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); | 199 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); |
| 199 #if defined(OS_CHROMEOS) | 200 #if defined(OS_CHROMEOS) |
| 200 output_configurator_->AddObserver(output_configurator_animation_.get()); | 201 output_configurator_->AddObserver(output_configurator_animation_.get()); |
| 201 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( | 202 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( |
| 202 output_configurator()); | 203 output_configurator()); |
| 203 #endif // defined(OS_CHROMEOS) | 204 #endif // defined(OS_CHROMEOS) |
| 204 } | 205 } |
| 205 | 206 |
| 206 Shell::~Shell() { | 207 Shell::~Shell() { |
| 207 views::FocusManagerFactory::Install(NULL); | 208 views::FocusManagerFactory::Install(NULL); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 aura::RootWindow* Shell::GetPrimaryRootWindow() { | 330 aura::RootWindow* Shell::GetPrimaryRootWindow() { |
| 330 return GetInstance()->display_controller()->GetPrimaryRootWindow(); | 331 return GetInstance()->display_controller()->GetPrimaryRootWindow(); |
| 331 } | 332 } |
| 332 | 333 |
| 333 // static | 334 // static |
| 334 aura::RootWindow* Shell::GetActiveRootWindow() { | 335 aura::RootWindow* Shell::GetActiveRootWindow() { |
| 335 return GetInstance()->active_root_window_; | 336 return GetInstance()->active_root_window_; |
| 336 } | 337 } |
| 337 | 338 |
| 338 // static | 339 // static |
| 340 gfx::Screen* Shell::GetAshScreen() { | |
| 341 return gfx::Screen::GetScreenFor(GetActiveRootWindow()); | |
|
oshima
2012/10/09 00:26:14
GetPrimaryRootWindow() is better. (it will never c
scottmg
2012/10/09 04:30:47
Done.
| |
| 342 } | |
| 343 | |
| 344 // static | |
| 339 Shell::RootWindowList Shell::GetAllRootWindows() { | 345 Shell::RootWindowList Shell::GetAllRootWindows() { |
| 340 return Shell::GetInstance()->display_controller()-> | 346 return Shell::GetInstance()->display_controller()-> |
| 341 GetAllRootWindows(); | 347 GetAllRootWindows(); |
| 342 } | 348 } |
| 343 | 349 |
| 344 // static | 350 // static |
| 345 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, | 351 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, |
| 346 int container_id) { | 352 int container_id) { |
| 347 return root_window->GetChildById(container_id); | 353 return root_window->GetChildById(container_id); |
| 348 } | 354 } |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 815 iter != controllers.end(); ++iter) { | 821 iter != controllers.end(); ++iter) { |
| 816 if ((*iter)->GetSystemModalLayoutManager()-> | 822 if ((*iter)->GetSystemModalLayoutManager()-> |
| 817 CanWindowReceiveEvents(window)) { | 823 CanWindowReceiveEvents(window)) { |
| 818 return true; | 824 return true; |
| 819 } | 825 } |
| 820 } | 826 } |
| 821 return false; | 827 return false; |
| 822 } | 828 } |
| 823 | 829 |
| 824 } // namespace ash | 830 } // namespace ash |
| OLD | NEW |