| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 delegate_(delegate), | 186 delegate_(delegate), |
| 187 #if defined(OS_CHROMEOS) | 187 #if defined(OS_CHROMEOS) |
| 188 output_configurator_(new chromeos::OutputConfigurator()), | 188 output_configurator_(new chromeos::OutputConfigurator()), |
| 189 output_configurator_animation_( | 189 output_configurator_animation_( |
| 190 new internal::OutputConfiguratorAnimation()), | 190 new internal::OutputConfiguratorAnimation()), |
| 191 #endif // defined(OS_CHROMEOS) | 191 #endif // defined(OS_CHROMEOS) |
| 192 shelf_(NULL), | 192 shelf_(NULL), |
| 193 panel_layout_manager_(NULL), | 193 panel_layout_manager_(NULL), |
| 194 status_area_widget_(NULL), | 194 status_area_widget_(NULL), |
| 195 browser_context_(NULL) { | 195 browser_context_(NULL) { |
| 196 gfx::Screen::SetInstance(screen_); | 196 gfx::Screen::SetInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_); |
| 197 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); | 197 ui_controls::InstallUIControlsAura(internal::CreateUIControls()); |
| 198 #if defined(OS_CHROMEOS) | 198 #if defined(OS_CHROMEOS) |
| 199 output_configurator_->AddObserver(output_configurator_animation_.get()); | 199 output_configurator_->AddObserver(output_configurator_animation_.get()); |
| 200 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( | 200 base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow( |
| 201 output_configurator()); | 201 output_configurator()); |
| 202 #endif // defined(OS_CHROMEOS) | 202 #endif // defined(OS_CHROMEOS) |
| 203 } | 203 } |
| 204 | 204 |
| 205 Shell::~Shell() { | 205 Shell::~Shell() { |
| 206 views::FocusManagerFactory::Install(NULL); | 206 views::FocusManagerFactory::Install(NULL); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 aura::RootWindow* Shell::GetPrimaryRootWindow() { | 328 aura::RootWindow* Shell::GetPrimaryRootWindow() { |
| 329 return GetInstance()->display_controller()->GetPrimaryRootWindow(); | 329 return GetInstance()->display_controller()->GetPrimaryRootWindow(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 // static | 332 // static |
| 333 aura::RootWindow* Shell::GetActiveRootWindow() { | 333 aura::RootWindow* Shell::GetActiveRootWindow() { |
| 334 return GetInstance()->active_root_window_; | 334 return GetInstance()->active_root_window_; |
| 335 } | 335 } |
| 336 | 336 |
| 337 // static | 337 // static |
| 338 gfx::NativeView Shell::GetRootNativeView() { |
| 339 return static_cast<gfx::NativeView>(GetActiveRootWindow()); |
| 340 } |
| 341 |
| 342 // static |
| 338 Shell::RootWindowList Shell::GetAllRootWindows() { | 343 Shell::RootWindowList Shell::GetAllRootWindows() { |
| 339 return Shell::GetInstance()->display_controller()-> | 344 return Shell::GetInstance()->display_controller()-> |
| 340 GetAllRootWindows(); | 345 GetAllRootWindows(); |
| 341 } | 346 } |
| 342 | 347 |
| 343 // static | 348 // static |
| 344 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, | 349 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, |
| 345 int container_id) { | 350 int container_id) { |
| 346 return root_window->GetChildById(container_id); | 351 return root_window->GetChildById(container_id); |
| 347 } | 352 } |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 } | 775 } |
| 771 | 776 |
| 772 void Shell::ShowCursor(bool visible) { | 777 void Shell::ShowCursor(bool visible) { |
| 773 RootWindowList root_windows = GetAllRootWindows(); | 778 RootWindowList root_windows = GetAllRootWindows(); |
| 774 for (RootWindowList::iterator iter = root_windows.begin(); | 779 for (RootWindowList::iterator iter = root_windows.begin(); |
| 775 iter != root_windows.end(); ++iter) | 780 iter != root_windows.end(); ++iter) |
| 776 (*iter)->ShowCursor(visible); | 781 (*iter)->ShowCursor(visible); |
| 777 } | 782 } |
| 778 | 783 |
| 779 } // namespace ash | 784 } // namespace ash |
| OLD | NEW |