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