Chromium Code Reviews| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "ash/accelerators/accelerator_controller.h" | 11 #include "ash/accelerators/accelerator_controller.h" |
| 12 #include "ash/accelerators/accelerator_delegate.h" | 12 #include "ash/accelerators/accelerator_delegate.h" |
| 13 #include "ash/accelerators/focus_manager_factory.h" | 13 #include "ash/accelerators/focus_manager_factory.h" |
| 14 #include "ash/aura/wm_shell_aura.h" | 14 #include "ash/aura/wm_shell_aura.h" |
| 15 #include "ash/aura/wm_window_aura.h" | 15 #include "ash/aura/wm_window_aura.h" |
| 16 #include "ash/autoclick/autoclick_controller.h" | 16 #include "ash/autoclick/autoclick_controller.h" |
| 17 #include "ash/common/accessibility_delegate.h" | 17 #include "ash/common/accessibility_delegate.h" |
| 18 #include "ash/common/ash_switches.h" | 18 #include "ash/common/ash_switches.h" |
| 19 #include "ash/common/keyboard/keyboard_ui.h" | 19 #include "ash/common/keyboard/keyboard_ui.h" |
| 20 #include "ash/common/login_status.h" | 20 #include "ash/common/login_status.h" |
| 21 #include "ash/common/session/session_state_delegate.h" | 21 #include "ash/common/session/session_state_delegate.h" |
| 22 #include "ash/common/shelf/shelf_item_delegate.h" | 22 #include "ash/common/shelf/shelf_item_delegate.h" |
| 23 #include "ash/common/shelf/shelf_item_delegate_manager.h" | 23 #include "ash/common/shelf/shelf_item_delegate_manager.h" |
| 24 #include "ash/common/shelf/shelf_model.h" | 24 #include "ash/common/shelf/shelf_model.h" |
| 25 #include "ash/common/shell_delegate.h" | |
| 25 #include "ash/common/shell_window_ids.h" | 26 #include "ash/common/shell_window_ids.h" |
| 26 #include "ash/common/system/locale/locale_notification_controller.h" | 27 #include "ash/common/system/locale/locale_notification_controller.h" |
| 27 #include "ash/common/system/tray/system_tray_delegate.h" | 28 #include "ash/common/system/tray/system_tray_delegate.h" |
| 28 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 29 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 29 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" | 30 #include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h" |
| 30 #include "ash/common/wm/mru_window_tracker.h" | 31 #include "ash/common/wm/mru_window_tracker.h" |
| 31 #include "ash/common/wm/root_window_finder.h" | 32 #include "ash/common/wm/root_window_finder.h" |
| 32 #include "ash/common/wm/window_positioner.h" | 33 #include "ash/common/wm/window_positioner.h" |
| 33 #include "ash/common/wm_shell.h" | 34 #include "ash/common/wm_shell.h" |
| 34 #include "ash/desktop_background/desktop_background_controller.h" | 35 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 52 #include "ash/magnifier/magnification_controller.h" | 53 #include "ash/magnifier/magnification_controller.h" |
| 53 #include "ash/magnifier/partial_magnification_controller.h" | 54 #include "ash/magnifier/partial_magnification_controller.h" |
| 54 #include "ash/new_window_delegate.h" | 55 #include "ash/new_window_delegate.h" |
| 55 #include "ash/pointer_watcher_delegate.h" | 56 #include "ash/pointer_watcher_delegate.h" |
| 56 #include "ash/root_window_controller.h" | 57 #include "ash/root_window_controller.h" |
| 57 #include "ash/shelf/app_list_shelf_item_delegate.h" | 58 #include "ash/shelf/app_list_shelf_item_delegate.h" |
| 58 #include "ash/shelf/shelf.h" | 59 #include "ash/shelf/shelf.h" |
| 59 #include "ash/shelf/shelf_delegate.h" | 60 #include "ash/shelf/shelf_delegate.h" |
| 60 #include "ash/shelf/shelf_widget.h" | 61 #include "ash/shelf/shelf_widget.h" |
| 61 #include "ash/shelf/shelf_window_watcher.h" | 62 #include "ash/shelf/shelf_window_watcher.h" |
| 62 #include "ash/shell_delegate.h" | |
| 63 #include "ash/shell_factory.h" | 63 #include "ash/shell_factory.h" |
| 64 #include "ash/shell_init_params.h" | 64 #include "ash/shell_init_params.h" |
| 65 #include "ash/system/status_area_widget.h" | 65 #include "ash/system/status_area_widget.h" |
| 66 #include "ash/system/toast/toast_manager.h" | 66 #include "ash/system/toast/toast_manager.h" |
| 67 #include "ash/utility/screenshot_controller.h" | 67 #include "ash/utility/screenshot_controller.h" |
| 68 #include "ash/wm/ash_focus_rules.h" | 68 #include "ash/wm/ash_focus_rules.h" |
| 69 #include "ash/wm/ash_native_cursor_manager.h" | 69 #include "ash/wm/ash_native_cursor_manager.h" |
| 70 #include "ash/wm/event_client_impl.h" | 70 #include "ash/wm/event_client_impl.h" |
| 71 #include "ash/wm/lock_state_controller.h" | 71 #include "ash/wm/lock_state_controller.h" |
| 72 #include "ash/wm/overlay_event_filter.h" | 72 #include "ash/wm/overlay_event_filter.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 return; | 313 return; |
| 314 | 314 |
| 315 aura::Window* root = WmWindowAura::GetAuraWindow( | 315 aura::Window* root = WmWindowAura::GetAuraWindow( |
| 316 wm::GetRootWindowMatching(gfx::Rect(location_in_screen, gfx::Size()))); | 316 wm::GetRootWindowMatching(gfx::Rect(location_in_screen, gfx::Size()))); |
| 317 GetRootWindowController(root)->ShowContextMenu(location_in_screen, | 317 GetRootWindowController(root)->ShowContextMenu(location_in_screen, |
| 318 source_type); | 318 source_type); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void Shell::ShowAppList(aura::Window* window) { | 321 void Shell::ShowAppList(aura::Window* window) { |
| 322 // If the context window is not given, show it on the target root window. | 322 // If the context window is not given, show it on the target root window. |
| 323 delegate_->GetAppListPresenter()->Show(GetDisplayIdForWindow(window)); | 323 wm_shell_->delegate()->GetAppListPresenter()->Show( |
| 324 GetDisplayIdForWindow(window)); | |
| 324 } | 325 } |
| 325 | 326 |
| 326 void Shell::DismissAppList() { | 327 void Shell::DismissAppList() { |
| 327 delegate_->GetAppListPresenter()->Dismiss(); | 328 wm_shell_->delegate()->GetAppListPresenter()->Dismiss(); |
| 328 } | 329 } |
| 329 | 330 |
| 330 void Shell::ToggleAppList(aura::Window* window) { | 331 void Shell::ToggleAppList(aura::Window* window) { |
| 331 // If the context window is not given, show it on the target root window. | 332 // If the context window is not given, show it on the target root window. |
| 332 delegate_->GetAppListPresenter()->ToggleAppList( | 333 wm_shell_->delegate()->GetAppListPresenter()->ToggleAppList( |
| 333 GetDisplayIdForWindow(window)); | 334 GetDisplayIdForWindow(window)); |
| 334 } | 335 } |
| 335 | 336 |
| 336 bool Shell::IsApplistVisible() const { | 337 bool Shell::IsApplistVisible() const { |
| 337 return delegate_->GetAppListPresenter()->IsVisible(); | 338 return wm_shell_->delegate()->GetAppListPresenter()->IsVisible(); |
| 338 } | 339 } |
| 339 | 340 |
| 340 bool Shell::GetAppListTargetVisibility() const { | 341 bool Shell::GetAppListTargetVisibility() const { |
| 341 return delegate_->GetAppListPresenter()->GetTargetVisibility(); | 342 return wm_shell_->delegate()->GetAppListPresenter()->GetTargetVisibility(); |
| 342 } | 343 } |
| 343 | 344 |
| 344 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( | 345 views::NonClientFrameView* Shell::CreateDefaultNonClientFrameView( |
| 345 views::Widget* widget) { | 346 views::Widget* widget) { |
| 346 // Use translucent-style window frames for dialogs. | 347 // Use translucent-style window frames for dialogs. |
| 347 return new CustomFrameViewAsh(widget); | 348 return new CustomFrameViewAsh(widget); |
| 348 } | 349 } |
| 349 | 350 |
| 350 void Shell::SetDisplayWorkAreaInsets(Window* contains, | 351 void Shell::SetDisplayWorkAreaInsets(Window* contains, |
| 351 const gfx::Insets& insets) { | 352 const gfx::Insets& insets) { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 SystemTray* Shell::GetPrimarySystemTray() { | 545 SystemTray* Shell::GetPrimarySystemTray() { |
| 545 return GetPrimaryRootWindowController()->GetSystemTray(); | 546 return GetPrimaryRootWindowController()->GetSystemTray(); |
| 546 } | 547 } |
| 547 | 548 |
| 548 ShelfDelegate* Shell::GetShelfDelegate() { | 549 ShelfDelegate* Shell::GetShelfDelegate() { |
| 549 if (!shelf_delegate_) { | 550 if (!shelf_delegate_) { |
| 550 // Creates ShelfItemDelegateManager before ShelfDelegate. | 551 // Creates ShelfItemDelegateManager before ShelfDelegate. |
| 551 shelf_item_delegate_manager_.reset( | 552 shelf_item_delegate_manager_.reset( |
| 552 new ShelfItemDelegateManager(shelf_model_.get())); | 553 new ShelfItemDelegateManager(shelf_model_.get())); |
| 553 | 554 |
| 554 shelf_delegate_.reset(delegate_->CreateShelfDelegate(shelf_model_.get())); | 555 shelf_delegate_.reset( |
| 556 wm_shell_->delegate()->CreateShelfDelegate(shelf_model_.get())); | |
| 555 std::unique_ptr<ShelfItemDelegate> controller(new AppListShelfItemDelegate); | 557 std::unique_ptr<ShelfItemDelegate> controller(new AppListShelfItemDelegate); |
| 556 | 558 |
| 557 // Finding the shelf model's location of the app list and setting its | 559 // Finding the shelf model's location of the app list and setting its |
| 558 // ShelfItemDelegate. | 560 // ShelfItemDelegate. |
| 559 int app_list_index = shelf_model_->GetItemIndexForType(TYPE_APP_LIST); | 561 int app_list_index = shelf_model_->GetItemIndexForType(TYPE_APP_LIST); |
| 560 DCHECK_GE(app_list_index, 0); | 562 DCHECK_GE(app_list_index, 0); |
| 561 ShelfID app_list_id = shelf_model_->items()[app_list_index].id; | 563 ShelfID app_list_id = shelf_model_->items()[app_list_index].id; |
| 562 DCHECK(app_list_id); | 564 DCHECK(app_list_id); |
| 563 shelf_item_delegate_manager_->SetShelfItemDelegate(app_list_id, | 565 shelf_item_delegate_manager_->SetShelfItemDelegate(app_list_id, |
| 564 std::move(controller)); | 566 std::move(controller)); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 592 void Shell::DoInitialWorkspaceAnimation() { | 594 void Shell::DoInitialWorkspaceAnimation() { |
| 593 return GetPrimaryRootWindowController() | 595 return GetPrimaryRootWindowController() |
| 594 ->workspace_controller() | 596 ->workspace_controller() |
| 595 ->DoInitialAnimation(); | 597 ->DoInitialAnimation(); |
| 596 } | 598 } |
| 597 | 599 |
| 598 //////////////////////////////////////////////////////////////////////////////// | 600 //////////////////////////////////////////////////////////////////////////////// |
| 599 // Shell, private: | 601 // Shell, private: |
| 600 | 602 |
| 601 Shell::Shell(ShellDelegate* delegate, base::SequencedWorkerPool* blocking_pool) | 603 Shell::Shell(ShellDelegate* delegate, base::SequencedWorkerPool* blocking_pool) |
| 602 : target_root_window_(nullptr), | 604 : wm_shell_(new WmShellAura(delegate)), |
|
James Cook
2016/07/06 21:27:27
It's nice that it works to move this here!
msw
2016/07/06 21:58:56
Acknowledged.
| |
| 605 target_root_window_(nullptr), | |
| 603 scoped_target_root_window_(nullptr), | 606 scoped_target_root_window_(nullptr), |
| 604 delegate_(delegate), | |
| 605 shelf_model_(new ShelfModel), | 607 shelf_model_(new ShelfModel), |
| 606 link_handler_model_factory_(nullptr), | 608 link_handler_model_factory_(nullptr), |
| 607 activation_client_(nullptr), | 609 activation_client_(nullptr), |
| 608 #if defined(OS_CHROMEOS) | 610 #if defined(OS_CHROMEOS) |
| 609 display_configurator_(new ui::DisplayConfigurator()), | 611 display_configurator_(new ui::DisplayConfigurator()), |
| 610 #endif // defined(OS_CHROMEOS) | 612 #endif // defined(OS_CHROMEOS) |
| 611 native_cursor_manager_(nullptr), | 613 native_cursor_manager_(nullptr), |
| 612 simulate_modal_window_open_for_testing_(false), | 614 simulate_modal_window_open_for_testing_(false), |
| 613 is_touch_hud_projection_enabled_(false), | 615 is_touch_hud_projection_enabled_(false), |
| 614 blocking_pool_(blocking_pool) { | 616 blocking_pool_(blocking_pool) { |
| 615 DCHECK(delegate_.get()); | |
| 616 DCHECK(aura::Env::GetInstanceDontCreate()); | 617 DCHECK(aura::Env::GetInstanceDontCreate()); |
| 617 gpu_support_.reset(delegate_->CreateGPUSupport()); | 618 gpu_support_.reset(wm_shell_->delegate()->CreateGPUSupport()); |
| 618 display_manager_.reset(new DisplayManager); | 619 display_manager_.reset(new DisplayManager); |
| 619 window_tree_host_manager_.reset(new WindowTreeHostManager); | 620 window_tree_host_manager_.reset(new WindowTreeHostManager); |
| 620 user_metrics_recorder_.reset(new UserMetricsRecorder); | 621 user_metrics_recorder_.reset(new UserMetricsRecorder); |
| 621 | 622 |
| 622 #if defined(OS_CHROMEOS) | 623 #if defined(OS_CHROMEOS) |
| 623 PowerStatus::Initialize(); | 624 PowerStatus::Initialize(); |
| 624 #endif | 625 #endif |
| 625 } | 626 } |
| 626 | 627 |
| 627 Shell::~Shell() { | 628 Shell::~Shell() { |
| 628 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); | 629 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); |
| 629 | 630 |
| 630 user_metrics_recorder_->OnShellShuttingDown(); | 631 user_metrics_recorder_->OnShellShuttingDown(); |
| 631 | 632 |
| 632 delegate_->PreShutdown(); | 633 wm_shell_->delegate()->PreShutdown(); |
| 633 | 634 |
| 634 views::FocusManagerFactory::Install(nullptr); | 635 views::FocusManagerFactory::Install(nullptr); |
| 635 | 636 |
| 636 // Remove the focus from any window. This will prevent overhead and side | 637 // Remove the focus from any window. This will prevent overhead and side |
| 637 // effects (e.g. crashes) from changing focus during shutdown. | 638 // effects (e.g. crashes) from changing focus during shutdown. |
| 638 // See bug crbug.com/134502. | 639 // See bug crbug.com/134502. |
| 639 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(nullptr); | 640 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(nullptr); |
| 640 | 641 |
| 641 // Please keep in same order as in Init() because it's easy to miss one. | 642 // Please keep in same order as in Init() because it's easy to miss one. |
| 642 if (window_modality_controller_) | 643 if (window_modality_controller_) |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 805 instance_ = nullptr; | 806 instance_ = nullptr; |
| 806 } | 807 } |
| 807 | 808 |
| 808 void Shell::Init(const ShellInitParams& init_params) { | 809 void Shell::Init(const ShellInitParams& init_params) { |
| 809 in_mus_ = init_params.in_mus; | 810 in_mus_ = init_params.in_mus; |
| 810 | 811 |
| 811 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 812 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 812 DCHECK(in_mus_) << "linux desktop does not support ash."; | 813 DCHECK(in_mus_) << "linux desktop does not support ash."; |
| 813 #endif | 814 #endif |
| 814 | 815 |
| 815 wm_shell_.reset(new WmShellAura); | |
| 816 scoped_overview_animation_settings_factory_.reset( | 816 scoped_overview_animation_settings_factory_.reset( |
| 817 new ScopedOverviewAnimationSettingsFactoryAura); | 817 new ScopedOverviewAnimationSettingsFactoryAura); |
| 818 window_positioner_.reset(new WindowPositioner(wm_shell_.get())); | 818 window_positioner_.reset(new WindowPositioner(wm_shell_.get())); |
| 819 | 819 |
| 820 if (!in_mus_) { | 820 if (!in_mus_) { |
| 821 native_cursor_manager_ = new AshNativeCursorManager; | 821 native_cursor_manager_ = new AshNativeCursorManager; |
| 822 #if defined(OS_CHROMEOS) | 822 #if defined(OS_CHROMEOS) |
| 823 cursor_manager_.reset( | 823 cursor_manager_.reset( |
| 824 new CursorManager(base::WrapUnique(native_cursor_manager_))); | 824 new CursorManager(base::WrapUnique(native_cursor_manager_))); |
| 825 #else | 825 #else |
| 826 cursor_manager_.reset( | 826 cursor_manager_.reset( |
| 827 new ::wm::CursorManager(base::WrapUnique(native_cursor_manager_))); | 827 new ::wm::CursorManager(base::WrapUnique(native_cursor_manager_))); |
| 828 #endif | 828 #endif |
| 829 } | 829 } |
| 830 | 830 |
| 831 delegate_->PreInit(); | 831 wm_shell_->delegate()->PreInit(); |
| 832 bool display_initialized = display_manager_->InitFromCommandLine(); | 832 bool display_initialized = display_manager_->InitFromCommandLine(); |
| 833 | 833 |
| 834 display_configuration_controller_.reset(new DisplayConfigurationController( | 834 display_configuration_controller_.reset(new DisplayConfigurationController( |
| 835 display_manager_.get(), window_tree_host_manager_.get())); | 835 display_manager_.get(), window_tree_host_manager_.get())); |
| 836 | 836 |
| 837 #if defined(OS_CHROMEOS) | 837 #if defined(OS_CHROMEOS) |
| 838 // When running as part of mash display configuration is handled by the mus | 838 // When running as part of mash display configuration is handled by the mus |
| 839 // process, so we won't try to configure displays here. | 839 // process, so we won't try to configure displays here. |
| 840 if (in_mus_) { | 840 if (in_mus_) { |
| 841 display_configurator_->set_configure_display(false); | 841 display_configurator_->set_configure_display(false); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 863 base::SysInfo::IsRunningOnChromeOS()) { | 863 base::SysInfo::IsRunningOnChromeOS()) { |
| 864 display_change_observer_.reset(new DisplayChangeObserver); | 864 display_change_observer_.reset(new DisplayChangeObserver); |
| 865 // Register |display_change_observer_| first so that the rest of | 865 // Register |display_change_observer_| first so that the rest of |
| 866 // observer gets invoked after the root windows are configured. | 866 // observer gets invoked after the root windows are configured. |
| 867 display_configurator_->AddObserver(display_change_observer_.get()); | 867 display_configurator_->AddObserver(display_change_observer_.get()); |
| 868 display_error_observer_.reset(new DisplayErrorObserver()); | 868 display_error_observer_.reset(new DisplayErrorObserver()); |
| 869 display_configurator_->AddObserver(display_error_observer_.get()); | 869 display_configurator_->AddObserver(display_error_observer_.get()); |
| 870 display_configurator_->set_state_controller(display_change_observer_.get()); | 870 display_configurator_->set_state_controller(display_change_observer_.get()); |
| 871 display_configurator_->set_mirroring_controller(display_manager_.get()); | 871 display_configurator_->set_mirroring_controller(display_manager_.get()); |
| 872 display_configurator_->ForceInitialConfigure( | 872 display_configurator_->ForceInitialConfigure( |
| 873 delegate_->IsFirstRunAfterBoot() ? kChromeOsBootColor : 0); | 873 wm_shell_->delegate()->IsFirstRunAfterBoot() ? kChromeOsBootColor : 0); |
| 874 display_initialized = true; | 874 display_initialized = true; |
| 875 } | 875 } |
| 876 display_color_manager_.reset( | 876 display_color_manager_.reset( |
| 877 new DisplayColorManager(display_configurator_.get(), blocking_pool_)); | 877 new DisplayColorManager(display_configurator_.get(), blocking_pool_)); |
| 878 #endif // defined(OS_CHROMEOS) | 878 #endif // defined(OS_CHROMEOS) |
| 879 | 879 |
| 880 if (!display_initialized) | 880 if (!display_initialized) |
| 881 display_manager_->InitDefaultDisplay(); | 881 display_manager_->InitDefaultDisplay(); |
| 882 | 882 |
| 883 display_manager_->RefreshFontParams(); | 883 display_manager_->RefreshFontParams(); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1003 | 1003 |
| 1004 tooltip_controller_.reset(new views::corewm::TooltipController( | 1004 tooltip_controller_.reset(new views::corewm::TooltipController( |
| 1005 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); | 1005 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); |
| 1006 AddPreTargetHandler(tooltip_controller_.get()); | 1006 AddPreTargetHandler(tooltip_controller_.get()); |
| 1007 | 1007 |
| 1008 event_client_.reset(new EventClientImpl); | 1008 event_client_.reset(new EventClientImpl); |
| 1009 | 1009 |
| 1010 // This controller needs to be set before SetupManagedWindowMode. | 1010 // This controller needs to be set before SetupManagedWindowMode. |
| 1011 desktop_background_controller_.reset( | 1011 desktop_background_controller_.reset( |
| 1012 new DesktopBackgroundController(blocking_pool_)); | 1012 new DesktopBackgroundController(blocking_pool_)); |
| 1013 user_wallpaper_delegate_.reset(delegate_->CreateUserWallpaperDelegate()); | 1013 user_wallpaper_delegate_.reset( |
| 1014 wm_shell_->delegate()->CreateUserWallpaperDelegate()); | |
| 1014 | 1015 |
| 1015 session_state_delegate_.reset(delegate_->CreateSessionStateDelegate()); | 1016 session_state_delegate_.reset( |
| 1016 accessibility_delegate_.reset(delegate_->CreateAccessibilityDelegate()); | 1017 wm_shell_->delegate()->CreateSessionStateDelegate()); |
| 1017 new_window_delegate_.reset(delegate_->CreateNewWindowDelegate()); | 1018 accessibility_delegate_.reset( |
| 1019 wm_shell_->delegate()->CreateAccessibilityDelegate()); | |
| 1020 new_window_delegate_.reset(wm_shell_->delegate()->CreateNewWindowDelegate()); | |
| 1018 wm_shell_->SetMediaDelegate( | 1021 wm_shell_->SetMediaDelegate( |
|
James Cook
2016/07/06 21:27:27
Could the media delegate be created inside WmShell
msw
2016/07/06 21:58:56
Yes, all of these other delegates should be create
| |
| 1019 base::WrapUnique(delegate_->CreateMediaDelegate())); | 1022 base::WrapUnique(wm_shell_->delegate()->CreateMediaDelegate())); |
| 1020 pointer_watcher_delegate_ = delegate_->CreatePointerWatcherDelegate(); | 1023 pointer_watcher_delegate_ = |
| 1024 wm_shell_->delegate()->CreatePointerWatcherDelegate(); | |
| 1021 | 1025 |
| 1022 resize_shadow_controller_.reset(new ResizeShadowController()); | 1026 resize_shadow_controller_.reset(new ResizeShadowController()); |
| 1023 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); | 1027 shadow_controller_.reset(new ::wm::ShadowController(activation_client_)); |
| 1024 | 1028 |
| 1025 wm_shell_->SetSystemTrayDelegate( | 1029 wm_shell_->SetSystemTrayDelegate( |
| 1026 base::WrapUnique(delegate()->CreateSystemTrayDelegate())); | 1030 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); |
|
James Cook
2016/07/06 21:27:27
ditto
msw
2016/07/06 21:58:56
See comment above.
| |
| 1027 | 1031 |
| 1028 locale_notification_controller_.reset(new LocaleNotificationController); | 1032 locale_notification_controller_.reset(new LocaleNotificationController); |
| 1029 | 1033 |
| 1030 // Initialize toast manager | 1034 // Initialize toast manager |
| 1031 toast_manager_.reset(new ToastManager); | 1035 toast_manager_.reset(new ToastManager); |
| 1032 | 1036 |
| 1033 #if defined(OS_CHROMEOS) | 1037 #if defined(OS_CHROMEOS) |
| 1034 // Create TouchTransformerController before | 1038 // Create TouchTransformerController before |
| 1035 // WindowTreeHostManager::InitDisplays() | 1039 // WindowTreeHostManager::InitDisplays() |
| 1036 // since TouchTransformerController listens on | 1040 // since TouchTransformerController listens on |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1100 if (keyboard::IsKeyboardEnabled()) { | 1104 if (keyboard::IsKeyboardEnabled()) { |
| 1101 if (keyboard::KeyboardController::GetInstance()) { | 1105 if (keyboard::KeyboardController::GetInstance()) { |
| 1102 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 1106 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| 1103 for (RootWindowControllerList::iterator iter = controllers.begin(); | 1107 for (RootWindowControllerList::iterator iter = controllers.begin(); |
| 1104 iter != controllers.end(); ++iter) { | 1108 iter != controllers.end(); ++iter) { |
| 1105 (*iter)->DeactivateKeyboard( | 1109 (*iter)->DeactivateKeyboard( |
| 1106 keyboard::KeyboardController::GetInstance()); | 1110 keyboard::KeyboardController::GetInstance()); |
| 1107 } | 1111 } |
| 1108 } | 1112 } |
| 1109 keyboard::KeyboardController::ResetInstance( | 1113 keyboard::KeyboardController::ResetInstance( |
| 1110 new keyboard::KeyboardController(delegate_->CreateKeyboardUI())); | 1114 new keyboard::KeyboardController( |
| 1115 wm_shell_->delegate()->CreateKeyboardUI())); | |
| 1111 } | 1116 } |
| 1112 } | 1117 } |
| 1113 | 1118 |
| 1114 void Shell::InitRootWindow(aura::Window* root_window) { | 1119 void Shell::InitRootWindow(aura::Window* root_window) { |
| 1115 DCHECK(activation_client_); | 1120 DCHECK(activation_client_); |
| 1116 DCHECK(visibility_controller_.get()); | 1121 DCHECK(visibility_controller_.get()); |
| 1117 DCHECK(drag_drop_controller_.get()); | 1122 DCHECK(drag_drop_controller_.get()); |
| 1118 | 1123 |
| 1119 aura::client::SetFocusClient(root_window, focus_client_.get()); | 1124 aura::client::SetFocusClient(root_window, focus_client_.get()); |
| 1120 aura::client::SetActivationClient(root_window, activation_client_); | 1125 aura::client::SetActivationClient(root_window, activation_client_); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1169 | 1174 |
| 1170 void Shell::OnWindowActivated( | 1175 void Shell::OnWindowActivated( |
| 1171 aura::client::ActivationChangeObserver::ActivationReason reason, | 1176 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1172 aura::Window* gained_active, | 1177 aura::Window* gained_active, |
| 1173 aura::Window* lost_active) { | 1178 aura::Window* lost_active) { |
| 1174 if (gained_active) | 1179 if (gained_active) |
| 1175 target_root_window_ = gained_active->GetRootWindow(); | 1180 target_root_window_ = gained_active->GetRootWindow(); |
| 1176 } | 1181 } |
| 1177 | 1182 |
| 1178 } // namespace ash | 1183 } // namespace ash |
| OLD | NEW |