| 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/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
| 11 #include "ash/accelerators/accelerator_filter.h" | 11 #include "ash/accelerators/accelerator_filter.h" |
| 12 #include "ash/accelerators/focus_manager_factory.h" | 12 #include "ash/accelerators/focus_manager_factory.h" |
| 13 #include "ash/accelerators/nested_dispatcher_controller.h" | 13 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 14 #include "ash/ash_switches.h" | 14 #include "ash/ash_switches.h" |
| 15 #include "ash/autoclick/autoclick_controller.h" | 15 #include "ash/autoclick/autoclick_controller.h" |
| 16 #include "ash/caps_lock_delegate.h" | 16 #include "ash/caps_lock_delegate.h" |
| 17 #include "ash/desktop_background/desktop_background_controller.h" | 17 #include "ash/desktop_background/desktop_background_controller.h" |
| 18 #include "ash/desktop_background/desktop_background_view.h" | 18 #include "ash/desktop_background/desktop_background_view.h" |
| 19 #include "ash/desktop_background/user_wallpaper_delegate.h" | 19 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 20 #include "ash/display/display_controller.h" | 20 #include "ash/display/display_controller.h" |
| 21 #include "ash/display/display_manager.h" | 21 #include "ash/display/display_manager.h" |
| 22 #include "ash/display/event_transformation_handler.h" | 22 #include "ash/display/event_transformation_handler.h" |
| 23 #include "ash/display/mouse_cursor_event_filter.h" | 23 #include "ash/display/mouse_cursor_event_filter.h" |
| 24 #include "ash/display/resolution_notification_controller.h" | 24 #include "ash/display/resolution_notification_controller.h" |
| 25 #include "ash/display/screen_position_controller.h" | 25 #include "ash/display/screen_position_controller.h" |
| 26 #include "ash/drag_drop/drag_drop_controller.h" | 26 #include "ash/drag_drop/drag_drop_controller.h" |
| 27 #include "ash/first_run/first_run_helper_impl.h" |
| 27 #include "ash/focus_cycler.h" | 28 #include "ash/focus_cycler.h" |
| 28 #include "ash/high_contrast/high_contrast_controller.h" | 29 #include "ash/high_contrast/high_contrast_controller.h" |
| 29 #include "ash/host/root_window_host_factory.h" | 30 #include "ash/host/root_window_host_factory.h" |
| 30 #include "ash/keyboard_uma_event_filter.h" | 31 #include "ash/keyboard_uma_event_filter.h" |
| 31 #include "ash/launcher/launcher_delegate.h" | 32 #include "ash/launcher/launcher_delegate.h" |
| 32 #include "ash/launcher/launcher_item_delegate.h" | 33 #include "ash/launcher/launcher_item_delegate.h" |
| 33 #include "ash/launcher/launcher_item_delegate_manager.h" | 34 #include "ash/launcher/launcher_item_delegate_manager.h" |
| 34 #include "ash/launcher/launcher_model.h" | 35 #include "ash/launcher/launcher_model.h" |
| 35 #include "ash/magnifier/magnification_controller.h" | 36 #include "ash/magnifier/magnification_controller.h" |
| 36 #include "ash/magnifier/partial_magnification_controller.h" | 37 #include "ash/magnifier/partial_magnification_controller.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 282 |
| 282 bool Shell::GetAppListTargetVisibility() const { | 283 bool Shell::GetAppListTargetVisibility() const { |
| 283 return app_list_controller_.get() && | 284 return app_list_controller_.get() && |
| 284 app_list_controller_->GetTargetVisibility(); | 285 app_list_controller_->GetTargetVisibility(); |
| 285 } | 286 } |
| 286 | 287 |
| 287 aura::Window* Shell::GetAppListWindow() { | 288 aura::Window* Shell::GetAppListWindow() { |
| 288 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; | 289 return app_list_controller_.get() ? app_list_controller_->GetWindow() : NULL; |
| 289 } | 290 } |
| 290 | 291 |
| 292 app_list::AppListView* Shell::GetAppListView() { |
| 293 return app_list_controller_.get() ? app_list_controller_->GetView() : NULL; |
| 294 } |
| 295 |
| 291 bool Shell::IsSystemModalWindowOpen() const { | 296 bool Shell::IsSystemModalWindowOpen() const { |
| 292 if (simulate_modal_window_open_for_testing_) | 297 if (simulate_modal_window_open_for_testing_) |
| 293 return true; | 298 return true; |
| 294 const std::vector<aura::Window*> containers = GetContainersFromAllRootWindows( | 299 const std::vector<aura::Window*> containers = GetContainersFromAllRootWindows( |
| 295 internal::kShellWindowId_SystemModalContainer, NULL); | 300 internal::kShellWindowId_SystemModalContainer, NULL); |
| 296 for (std::vector<aura::Window*>::const_iterator cit = containers.begin(); | 301 for (std::vector<aura::Window*>::const_iterator cit = containers.begin(); |
| 297 cit != containers.end(); ++cit) { | 302 cit != containers.end(); ++cit) { |
| 298 for (aura::Window::Windows::const_iterator wit = (*cit)->children().begin(); | 303 for (aura::Window::Windows::const_iterator wit = (*cit)->children().begin(); |
| 299 wit != (*cit)->children().end(); ++wit) { | 304 wit != (*cit)->children().end(); ++wit) { |
| 300 if ((*wit)->GetProperty(aura::client::kModalKey) == | 305 if ((*wit)->GetProperty(aura::client::kModalKey) == |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 514 |
| 510 void Shell::SetTouchHudProjectionEnabled(bool enabled) { | 515 void Shell::SetTouchHudProjectionEnabled(bool enabled) { |
| 511 if (is_touch_hud_projection_enabled_ == enabled) | 516 if (is_touch_hud_projection_enabled_ == enabled) |
| 512 return; | 517 return; |
| 513 | 518 |
| 514 is_touch_hud_projection_enabled_ = enabled; | 519 is_touch_hud_projection_enabled_ = enabled; |
| 515 FOR_EACH_OBSERVER(ShellObserver, observers_, | 520 FOR_EACH_OBSERVER(ShellObserver, observers_, |
| 516 OnTouchHudProjectionToggled(enabled)); | 521 OnTouchHudProjectionToggled(enabled)); |
| 517 } | 522 } |
| 518 | 523 |
| 524 #if defined(OS_CHROMEOS) |
| 525 ash::FirstRunHelper* Shell::CreateFirstRunHelper() { |
| 526 return new ash::FirstRunHelperImpl; |
| 527 } |
| 528 #endif // defined(OS_CHROMEOS) |
| 529 |
| 519 void Shell::DoInitialWorkspaceAnimation() { | 530 void Shell::DoInitialWorkspaceAnimation() { |
| 520 return GetPrimaryRootWindowController()->workspace_controller()-> | 531 return GetPrimaryRootWindowController()->workspace_controller()-> |
| 521 DoInitialAnimation(); | 532 DoInitialAnimation(); |
| 522 } | 533 } |
| 523 | 534 |
| 524 //////////////////////////////////////////////////////////////////////////////// | 535 //////////////////////////////////////////////////////////////////////////////// |
| 525 // Shell, private: | 536 // Shell, private: |
| 526 | 537 |
| 527 Shell::Shell(ShellDelegate* delegate) | 538 Shell::Shell(ShellDelegate* delegate) |
| 528 : screen_(new ScreenAsh), | 539 : screen_(new ScreenAsh), |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 //////////////////////////////////////////////////////////////////////////////// | 979 //////////////////////////////////////////////////////////////////////////////// |
| 969 // Shell, aura::client::ActivationChangeObserver implementation: | 980 // Shell, aura::client::ActivationChangeObserver implementation: |
| 970 | 981 |
| 971 void Shell::OnWindowActivated(aura::Window* gained_active, | 982 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 972 aura::Window* lost_active) { | 983 aura::Window* lost_active) { |
| 973 if (gained_active) | 984 if (gained_active) |
| 974 target_root_window_ = gained_active->GetRootWindow(); | 985 target_root_window_ = gained_active->GetRootWindow(); |
| 975 } | 986 } |
| 976 | 987 |
| 977 } // namespace ash | 988 } // namespace ash |
| OLD | NEW |