| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 // of its owned RootWindowControllers relies on the value. | 317 // of its owned RootWindowControllers relies on the value. |
| 318 display_controller_->Shutdown(); | 318 display_controller_->Shutdown(); |
| 319 display_controller_.reset(); | 319 display_controller_.reset(); |
| 320 screen_position_controller_.reset(); | 320 screen_position_controller_.reset(); |
| 321 | 321 |
| 322 // Delete the activation controller after other controllers and launcher | 322 // Delete the activation controller after other controllers and launcher |
| 323 // because they might have registered ActivationChangeObserver. | 323 // because they might have registered ActivationChangeObserver. |
| 324 activation_controller_.reset(); | 324 activation_controller_.reset(); |
| 325 | 325 |
| 326 #if defined(OS_CHROMEOS) && defined(USE_X11) | 326 #if defined(OS_CHROMEOS) && defined(USE_X11) |
| 327 if (display_change_observer_) | 327 if (display_change_observer_) |
| 328 output_configurator_->RemoveObserver(display_change_observer_.get()); | 328 output_configurator_->RemoveObserver(display_change_observer_.get()); |
| 329 if (output_configurator_animation_) | 329 if (output_configurator_animation_) |
| 330 output_configurator_->RemoveObserver(output_configurator_animation_.get()); | 330 output_configurator_->RemoveObserver(output_configurator_animation_.get()); |
| 331 if (display_error_observer_) | 331 if (display_error_observer_) |
| 332 output_configurator_->RemoveObserver(display_error_observer_.get()); | 332 output_configurator_->RemoveObserver(display_error_observer_.get()); |
| 333 base::MessagePumpAuraX11::Current()->RemoveDispatcherForRootWindow( | 333 base::MessagePumpAuraX11::Current()->RemoveDispatcherForRootWindow( |
| 334 output_configurator()); | 334 output_configurator()); |
| 335 base::MessagePumpAuraX11::Current()->RemoveObserver(output_configurator()); | 335 base::MessagePumpAuraX11::Current()->RemoveObserver(output_configurator()); |
| 336 display_change_observer_.reset(); | 336 display_change_observer_.reset(); |
| 337 #endif // defined(OS_CHROMEOS) | 337 #endif // defined(OS_CHROMEOS) |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 | 684 |
| 685 bool Shell::GetAppListTargetVisibility() const { | 685 bool Shell::GetAppListTargetVisibility() const { |
| 686 return app_list_controller_.get() && | 686 return app_list_controller_.get() && |
| 687 app_list_controller_->GetTargetVisibility(); | 687 app_list_controller_->GetTargetVisibility(); |
| 688 } | 688 } |
| 689 | 689 |
| 690 aura::Window* Shell::GetAppListWindow() { | 690 aura::Window* Shell::GetAppListWindow() { |
| 691 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; | 691 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; |
| 692 } | 692 } |
| 693 | 693 |
| 694 void Shell::ShowAppListAppsGrid() { |
| 695 if (app_list_controller_) |
| 696 app_list_controller_->ShowAppsGrid(); |
| 697 } |
| 698 |
| 694 bool Shell::IsSystemModalWindowOpen() const { | 699 bool Shell::IsSystemModalWindowOpen() const { |
| 695 if (simulate_modal_window_open_for_testing_) | 700 if (simulate_modal_window_open_for_testing_) |
| 696 return true; | 701 return true; |
| 697 const std::vector<aura::Window*> containers = GetContainersFromAllRootWindows( | 702 const std::vector<aura::Window*> containers = GetContainersFromAllRootWindows( |
| 698 internal::kShellWindowId_SystemModalContainer, NULL); | 703 internal::kShellWindowId_SystemModalContainer, NULL); |
| 699 for (std::vector<aura::Window*>::const_iterator cit = containers.begin(); | 704 for (std::vector<aura::Window*>::const_iterator cit = containers.begin(); |
| 700 cit != containers.end(); ++cit) { | 705 cit != containers.end(); ++cit) { |
| 701 for (aura::Window::Windows::const_iterator wit = (*cit)->children().begin(); | 706 for (aura::Window::Windows::const_iterator wit = (*cit)->children().begin(); |
| 702 wit != (*cit)->children().end(); ++wit) { | 707 wit != (*cit)->children().end(); ++wit) { |
| 703 if ((*wit)->GetProperty(aura::client::kModalKey) == | 708 if ((*wit)->GetProperty(aura::client::kModalKey) == |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 //////////////////////////////////////////////////////////////////////////////// | 978 //////////////////////////////////////////////////////////////////////////////// |
| 974 // Shell, aura::client::ActivationChangeObserver implementation: | 979 // Shell, aura::client::ActivationChangeObserver implementation: |
| 975 | 980 |
| 976 void Shell::OnWindowActivated(aura::Window* gained_active, | 981 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 977 aura::Window* lost_active) { | 982 aura::Window* lost_active) { |
| 978 if (gained_active) | 983 if (gained_active) |
| 979 target_root_window_ = gained_active->GetRootWindow(); | 984 target_root_window_ = gained_active->GetRootWindow(); |
| 980 } | 985 } |
| 981 | 986 |
| 982 } // namespace ash | 987 } // namespace ash |
| OLD | NEW |