| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 // These need a valid Shell instance to clean up properly, so explicitly | 250 // These need a valid Shell instance to clean up properly, so explicitly |
| 251 // delete them before invalidating the instance. | 251 // delete them before invalidating the instance. |
| 252 // Alphabetical. | 252 // Alphabetical. |
| 253 drag_drop_controller_.reset(); | 253 drag_drop_controller_.reset(); |
| 254 magnification_controller_.reset(); | 254 magnification_controller_.reset(); |
| 255 power_button_controller_.reset(); | 255 power_button_controller_.reset(); |
| 256 resize_shadow_controller_.reset(); | 256 resize_shadow_controller_.reset(); |
| 257 shadow_controller_.reset(); | 257 shadow_controller_.reset(); |
| 258 tooltip_controller_.reset(); | 258 tooltip_controller_.reset(); |
| 259 event_client_.reset(); |
| 259 window_cycle_controller_.reset(); | 260 window_cycle_controller_.reset(); |
| 260 capture_controller_.reset(); | 261 capture_controller_.reset(); |
| 261 nested_dispatcher_controller_.reset(); | 262 nested_dispatcher_controller_.reset(); |
| 262 user_action_client_.reset(); | 263 user_action_client_.reset(); |
| 263 visibility_controller_.reset(); | 264 visibility_controller_.reset(); |
| 264 | 265 |
| 265 // This also deletes all RootWindows. | 266 // This also deletes all RootWindows. |
| 266 display_controller_.reset(); | 267 display_controller_.reset(); |
| 267 screen_position_controller_.reset(); | 268 screen_position_controller_.reset(); |
| 268 | 269 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 GetAllRootWindows(); | 342 GetAllRootWindows(); |
| 342 } | 343 } |
| 343 | 344 |
| 344 // static | 345 // static |
| 345 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, | 346 aura::Window* Shell::GetContainer(aura::RootWindow* root_window, |
| 346 int container_id) { | 347 int container_id) { |
| 347 return root_window->GetChildById(container_id); | 348 return root_window->GetChildById(container_id); |
| 348 } | 349 } |
| 349 | 350 |
| 350 // static | 351 // static |
| 352 const aura::Window* Shell::GetContainer(const aura::RootWindow* root_window, |
| 353 int container_id) { |
| 354 return root_window->GetChildById(container_id); |
| 355 } |
| 356 |
| 357 // static |
| 351 std::vector<aura::Window*> Shell::GetAllContainers(int container_id) { | 358 std::vector<aura::Window*> Shell::GetAllContainers(int container_id) { |
| 352 std::vector<aura::Window*> containers; | 359 std::vector<aura::Window*> containers; |
| 353 aura::Window* container = GetPrimaryRootWindow()->GetChildById(container_id); | 360 aura::Window* container = GetPrimaryRootWindow()->GetChildById(container_id); |
| 354 if (container) | 361 if (container) |
| 355 containers.push_back(container); | 362 containers.push_back(container); |
| 356 return containers; | 363 return containers; |
| 357 } | 364 } |
| 358 | 365 |
| 359 void Shell::Init() { | 366 void Shell::Init() { |
| 360 // Install the custom factory first so that views::FocusManagers for Tray, | 367 // Install the custom factory first so that views::FocusManagers for Tray, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 | 448 |
| 442 high_contrast_controller_.reset(new HighContrastController); | 449 high_contrast_controller_.reset(new HighContrastController); |
| 443 video_detector_.reset(new VideoDetector); | 450 video_detector_.reset(new VideoDetector); |
| 444 window_cycle_controller_.reset( | 451 window_cycle_controller_.reset( |
| 445 new WindowCycleController(activation_controller_.get())); | 452 new WindowCycleController(activation_controller_.get())); |
| 446 | 453 |
| 447 tooltip_controller_.reset(new internal::TooltipController( | 454 tooltip_controller_.reset(new internal::TooltipController( |
| 448 drag_drop_controller_.get())); | 455 drag_drop_controller_.get())); |
| 449 AddEnvEventFilter(tooltip_controller_.get()); | 456 AddEnvEventFilter(tooltip_controller_.get()); |
| 450 | 457 |
| 458 event_client_.reset(new internal::EventClientImpl); |
| 459 |
| 451 InitRootWindowController(root_window_controller); | 460 InitRootWindowController(root_window_controller); |
| 452 | 461 |
| 453 // This controller needs to be set before SetupManagedWindowMode. | 462 // This controller needs to be set before SetupManagedWindowMode. |
| 454 desktop_background_controller_.reset(new DesktopBackgroundController()); | 463 desktop_background_controller_.reset(new DesktopBackgroundController()); |
| 455 if (delegate_.get()) | 464 if (delegate_.get()) |
| 456 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate()); | 465 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate()); |
| 457 if (!user_wallpaper_delegate_.get()) | 466 if (!user_wallpaper_delegate_.get()) |
| 458 user_wallpaper_delegate_.reset(new DummyUserWallpaperDelegate()); | 467 user_wallpaper_delegate_.reset(new DummyUserWallpaperDelegate()); |
| 459 | 468 |
| 460 // Launcher must be created after secondary displays are initialized. | 469 // Launcher must be created after secondary displays are initialized. |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 root_window->set_focus_manager(focus_manager_.get()); | 733 root_window->set_focus_manager(focus_manager_.get()); |
| 725 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window); | 734 input_method_filter_->SetInputMethodPropertyInRootWindow(root_window); |
| 726 aura::client::SetActivationClient(root_window, activation_controller_.get()); | 735 aura::client::SetActivationClient(root_window, activation_controller_.get()); |
| 727 aura::client::SetVisibilityClient(root_window, visibility_controller_.get()); | 736 aura::client::SetVisibilityClient(root_window, visibility_controller_.get()); |
| 728 aura::client::SetDragDropClient(root_window, drag_drop_controller_.get()); | 737 aura::client::SetDragDropClient(root_window, drag_drop_controller_.get()); |
| 729 aura::client::SetCaptureClient(root_window, capture_controller_.get()); | 738 aura::client::SetCaptureClient(root_window, capture_controller_.get()); |
| 730 aura::client::SetScreenPositionClient(root_window, | 739 aura::client::SetScreenPositionClient(root_window, |
| 731 screen_position_controller_.get()); | 740 screen_position_controller_.get()); |
| 732 aura::client::SetCursorClient(root_window, &cursor_manager_); | 741 aura::client::SetCursorClient(root_window, &cursor_manager_); |
| 733 aura::client::SetTooltipClient(root_window, tooltip_controller_.get()); | 742 aura::client::SetTooltipClient(root_window, tooltip_controller_.get()); |
| 743 aura::client::SetEventClient(root_window, event_client_.get()); |
| 734 | 744 |
| 735 if (nested_dispatcher_controller_.get()) { | 745 if (nested_dispatcher_controller_.get()) { |
| 736 aura::client::SetDispatcherClient(root_window, | 746 aura::client::SetDispatcherClient(root_window, |
| 737 nested_dispatcher_controller_.get()); | 747 nested_dispatcher_controller_.get()); |
| 738 } | 748 } |
| 739 if (user_action_client_.get()) | 749 if (user_action_client_.get()) |
| 740 aura::client::SetUserActionClient(root_window, user_action_client_.get()); | 750 aura::client::SetUserActionClient(root_window, user_action_client_.get()); |
| 741 | 751 |
| 742 root_window->SetCursor(ui::kCursorPointer); | 752 root_window->SetCursor(ui::kCursorPointer); |
| 743 controller->InitLayoutManagers(); | 753 controller->InitLayoutManagers(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 iter != controllers.end(); ++iter) { | 825 iter != controllers.end(); ++iter) { |
| 816 if ((*iter)->GetSystemModalLayoutManager()-> | 826 if ((*iter)->GetSystemModalLayoutManager()-> |
| 817 CanWindowReceiveEvents(window)) { | 827 CanWindowReceiveEvents(window)) { |
| 818 return true; | 828 return true; |
| 819 } | 829 } |
| 820 } | 830 } |
| 821 return false; | 831 return false; |
| 822 } | 832 } |
| 823 | 833 |
| 824 } // namespace ash | 834 } // namespace ash |
| OLD | NEW |