| 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 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 #include "base/command_line.h" | 103 #include "base/command_line.h" |
| 104 #include "base/memory/ptr_util.h" | 104 #include "base/memory/ptr_util.h" |
| 105 #include "base/sys_info.h" | 105 #include "base/sys_info.h" |
| 106 #include "base/threading/sequenced_worker_pool.h" | 106 #include "base/threading/sequenced_worker_pool.h" |
| 107 #include "base/trace_event/trace_event.h" | 107 #include "base/trace_event/trace_event.h" |
| 108 #include "chromeos/audio/audio_a11y_controller.h" | 108 #include "chromeos/audio/audio_a11y_controller.h" |
| 109 #include "chromeos/chromeos_switches.h" | 109 #include "chromeos/chromeos_switches.h" |
| 110 #include "chromeos/dbus/dbus_thread_manager.h" | 110 #include "chromeos/dbus/dbus_thread_manager.h" |
| 111 #include "chromeos/system/devicemode.h" | 111 #include "chromeos/system/devicemode.h" |
| 112 #include "components/ui_devtools/devtools_server.h" | 112 #include "components/ui_devtools/devtools_server.h" |
| 113 #include "services/preferences/public/cpp/pref_client_store.h" |
| 114 #include "services/preferences/public/interfaces/preferences.mojom.h" |
| 113 #include "services/service_manager/public/cpp/connector.h" | 115 #include "services/service_manager/public/cpp/connector.h" |
| 114 #include "services/ui/public/interfaces/constants.mojom.h" | 116 #include "services/ui/public/interfaces/constants.mojom.h" |
| 115 #include "ui/aura/client/aura_constants.h" | 117 #include "ui/aura/client/aura_constants.h" |
| 116 #include "ui/aura/env.h" | 118 #include "ui/aura/env.h" |
| 117 #include "ui/aura/layout_manager.h" | 119 #include "ui/aura/layout_manager.h" |
| 118 #include "ui/aura/mus/user_activity_forwarder.h" | 120 #include "ui/aura/mus/user_activity_forwarder.h" |
| 119 #include "ui/aura/window.h" | 121 #include "ui/aura/window.h" |
| 120 #include "ui/aura/window_event_dispatcher.h" | 122 #include "ui/aura/window_event_dispatcher.h" |
| 121 #include "ui/base/ui_base_switches.h" | 123 #include "ui/base/ui_base_switches.h" |
| 122 #include "ui/base/user_activity/user_activity_detector.h" | 124 #include "ui/base/user_activity/user_activity_detector.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 bool Shell::initially_hide_cursor_ = false; | 194 bool Shell::initially_hide_cursor_ = false; |
| 193 | 195 |
| 194 //////////////////////////////////////////////////////////////////////////////// | 196 //////////////////////////////////////////////////////////////////////////////// |
| 195 // Shell, public: | 197 // Shell, public: |
| 196 | 198 |
| 197 // static | 199 // static |
| 198 Shell* Shell::CreateInstance(const ShellInitParams& init_params) { | 200 Shell* Shell::CreateInstance(const ShellInitParams& init_params) { |
| 199 CHECK(!instance_); | 201 CHECK(!instance_); |
| 200 WmShell* wm_shell = init_params.wm_shell; | 202 WmShell* wm_shell = init_params.wm_shell; |
| 201 if (!wm_shell) | 203 if (!wm_shell) |
| 202 wm_shell = | 204 wm_shell = new WmShellAura(); |
| 203 new WmShellAura(base::WrapUnique<ShellDelegate>(init_params.delegate)); | 205 instance_ = new Shell(base::WrapUnique<ShellDelegate>(init_params.delegate), |
| 204 instance_ = new Shell(base::WrapUnique<WmShell>(wm_shell)); | 206 base::WrapUnique<WmShell>(wm_shell)); |
| 205 instance_->Init(init_params); | 207 instance_->Init(init_params); |
| 206 return instance_; | 208 return instance_; |
| 207 } | 209 } |
| 208 | 210 |
| 209 // static | 211 // static |
| 210 Shell* Shell::GetInstance() { | 212 Shell* Shell::Get() { |
| 211 CHECK(instance_); | 213 CHECK(instance_); |
| 212 return instance_; | 214 return instance_; |
| 213 } | 215 } |
| 214 | 216 |
| 215 // static | 217 // static |
| 216 bool Shell::HasInstance() { | 218 bool Shell::HasInstance() { |
| 217 return !!instance_; | 219 return !!instance_; |
| 218 } | 220 } |
| 219 | 221 |
| 220 // static | 222 // static |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 } | 473 } |
| 472 | 474 |
| 473 void Shell::NotifyShelfAutoHideBehaviorChanged(WmWindow* root_window) { | 475 void Shell::NotifyShelfAutoHideBehaviorChanged(WmWindow* root_window) { |
| 474 for (auto& observer : shell_observers_) | 476 for (auto& observer : shell_observers_) |
| 475 observer.OnShelfAutoHideBehaviorChanged(root_window); | 477 observer.OnShelfAutoHideBehaviorChanged(root_window); |
| 476 } | 478 } |
| 477 | 479 |
| 478 //////////////////////////////////////////////////////////////////////////////// | 480 //////////////////////////////////////////////////////////////////////////////// |
| 479 // Shell, private: | 481 // Shell, private: |
| 480 | 482 |
| 481 Shell::Shell(std::unique_ptr<WmShell> wm_shell) | 483 Shell::Shell(std::unique_ptr<ShellDelegate> shell_delegate, |
| 484 std::unique_ptr<WmShell> wm_shell) |
| 482 : wm_shell_(std::move(wm_shell)), | 485 : wm_shell_(std::move(wm_shell)), |
| 486 shell_delegate_(std::move(shell_delegate)), |
| 483 link_handler_model_factory_(nullptr), | 487 link_handler_model_factory_(nullptr), |
| 484 display_configurator_(new display::DisplayConfigurator()), | 488 display_configurator_(new display::DisplayConfigurator()), |
| 485 native_cursor_manager_(nullptr), | 489 native_cursor_manager_(nullptr), |
| 486 simulate_modal_window_open_for_testing_(false), | 490 simulate_modal_window_open_for_testing_(false), |
| 487 is_touch_hud_projection_enabled_(false) { | 491 is_touch_hud_projection_enabled_(false) { |
| 488 // TODO(sky): better refactor cash/mash dependencies. Perhaps put all cash | 492 // TODO(sky): better refactor cash/mash dependencies. Perhaps put all cash |
| 489 // state on WmShellAura. http://crbug.com/671246. | 493 // state on WmShellAura. http://crbug.com/671246. |
| 490 | 494 |
| 491 if (!wm_shell_->IsRunningInMash()) { | 495 if (!wm_shell_->IsRunningInMash()) { |
| 492 gpu_support_.reset(wm_shell_->delegate()->CreateGPUSupport()); | 496 gpu_support_.reset(shell_delegate_->CreateGPUSupport()); |
| 493 display_manager_.reset(ScreenAsh::CreateDisplayManager()); | 497 display_manager_.reset(ScreenAsh::CreateDisplayManager()); |
| 494 window_tree_host_manager_.reset(new WindowTreeHostManager); | 498 window_tree_host_manager_.reset(new WindowTreeHostManager); |
| 495 user_metrics_recorder_.reset(new UserMetricsRecorder); | 499 user_metrics_recorder_.reset(new UserMetricsRecorder); |
| 496 } | 500 } |
| 497 | 501 |
| 498 PowerStatus::Initialize(); | 502 PowerStatus::Initialize(); |
| 499 } | 503 } |
| 500 | 504 |
| 501 Shell::~Shell() { | 505 Shell::~Shell() { |
| 502 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); | 506 TRACE_EVENT0("shutdown", "ash::Shell::Destructor"); |
| 503 | 507 |
| 504 const bool is_mash = wm_shell_->IsRunningInMash(); | 508 const bool is_mash = wm_shell_->IsRunningInMash(); |
| 505 | 509 |
| 506 if (!is_mash) | 510 if (!is_mash) |
| 507 user_metrics_recorder_->OnShellShuttingDown(); | 511 user_metrics_recorder_->OnShellShuttingDown(); |
| 508 | 512 |
| 509 wm_shell_->delegate()->PreShutdown(); | 513 shell_delegate_->PreShutdown(); |
| 510 | 514 |
| 511 // Remove the focus from any window. This will prevent overhead and side | 515 // Remove the focus from any window. This will prevent overhead and side |
| 512 // effects (e.g. crashes) from changing focus during shutdown. | 516 // effects (e.g. crashes) from changing focus during shutdown. |
| 513 // See bug crbug.com/134502. | 517 // See bug crbug.com/134502. |
| 514 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(nullptr); | 518 aura::client::GetFocusClient(GetPrimaryRootWindow())->FocusWindow(nullptr); |
| 515 | 519 |
| 516 // Please keep in same order as in Init() because it's easy to miss one. | 520 // Please keep in same order as in Init() because it's easy to miss one. |
| 517 if (window_modality_controller_) | 521 if (window_modality_controller_) |
| 518 window_modality_controller_.reset(); | 522 window_modality_controller_.reset(); |
| 519 if (!is_mash) { | 523 if (!is_mash) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 display_change_observer_.reset(); | 658 display_change_observer_.reset(); |
| 655 shutdown_observer_.reset(); | 659 shutdown_observer_.reset(); |
| 656 | 660 |
| 657 PowerStatus::Shutdown(); | 661 PowerStatus::Shutdown(); |
| 658 | 662 |
| 659 // Ensure that DBusThreadManager outlives this Shell. | 663 // Ensure that DBusThreadManager outlives this Shell. |
| 660 DCHECK(chromeos::DBusThreadManager::IsInitialized()); | 664 DCHECK(chromeos::DBusThreadManager::IsInitialized()); |
| 661 | 665 |
| 662 // Needs to happen right before |instance_| is reset. | 666 // Needs to happen right before |instance_| is reset. |
| 663 wm_shell_.reset(); | 667 wm_shell_.reset(); |
| 668 wallpaper_delegate_.reset(); |
| 669 pref_store_ = nullptr; |
| 670 shell_delegate_.reset(); |
| 664 | 671 |
| 665 DCHECK(instance_ == this); | 672 DCHECK(instance_ == this); |
| 666 instance_ = nullptr; | 673 instance_ = nullptr; |
| 667 } | 674 } |
| 668 | 675 |
| 669 void Shell::Init(const ShellInitParams& init_params) { | 676 void Shell::Init(const ShellInitParams& init_params) { |
| 670 const bool is_mash = wm_shell_->IsRunningInMash(); | 677 const bool is_mash = wm_shell_->IsRunningInMash(); |
| 671 | 678 |
| 672 blocking_pool_ = init_params.blocking_pool; | 679 blocking_pool_ = init_params.blocking_pool; |
| 673 | 680 |
| 681 wallpaper_delegate_ = shell_delegate_->CreateWallpaperDelegate(); |
| 682 |
| 683 // Can be null in tests. |
| 684 if (shell_delegate_->GetShellConnector()) { |
| 685 prefs::mojom::PreferencesServiceFactoryPtr pref_factory_ptr; |
| 686 shell_delegate_->GetShellConnector()->BindInterface( |
| 687 prefs::mojom::kServiceName, &pref_factory_ptr); |
| 688 pref_store_ = new preferences::PrefClientStore(std::move(pref_factory_ptr)); |
| 689 } |
| 690 |
| 674 // Some delegates access WmShell during their construction. Create them here | 691 // Some delegates access WmShell during their construction. Create them here |
| 675 // instead of the WmShell constructor. | 692 // instead of the WmShell constructor. |
| 676 accessibility_delegate_.reset( | 693 accessibility_delegate_.reset(shell_delegate_->CreateAccessibilityDelegate()); |
| 677 wm_shell_->delegate()->CreateAccessibilityDelegate()); | 694 palette_delegate_ = shell_delegate_->CreatePaletteDelegate(); |
| 678 palette_delegate_ = wm_shell_->delegate()->CreatePaletteDelegate(); | |
| 679 toast_manager_ = base::MakeUnique<ToastManager>(); | 695 toast_manager_ = base::MakeUnique<ToastManager>(); |
| 680 | 696 |
| 681 // Create the app list item in the shelf data model. | 697 // Create the app list item in the shelf data model. |
| 682 AppListShelfItemDelegate::CreateAppListItemAndDelegate( | 698 AppListShelfItemDelegate::CreateAppListItemAndDelegate( |
| 683 wm_shell_->shelf_model()); | 699 wm_shell_->shelf_model()); |
| 684 | 700 |
| 685 // Install the custom factory early on so that views::FocusManagers for Tray, | 701 // Install the custom factory early on so that views::FocusManagers for Tray, |
| 686 // Shelf, and WallPaper could be created by the factory. | 702 // Shelf, and WallPaper could be created by the factory. |
| 687 views::FocusManagerFactory::Install(new AshFocusManagerFactory); | 703 views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
| 688 | 704 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 711 scoped_overview_animation_settings_factory_.reset( | 727 scoped_overview_animation_settings_factory_.reset( |
| 712 new ScopedOverviewAnimationSettingsFactoryAura); | 728 new ScopedOverviewAnimationSettingsFactoryAura); |
| 713 window_positioner_.reset(new WindowPositioner(wm_shell_.get())); | 729 window_positioner_.reset(new WindowPositioner(wm_shell_.get())); |
| 714 | 730 |
| 715 if (!is_mash) { | 731 if (!is_mash) { |
| 716 native_cursor_manager_ = new AshNativeCursorManager; | 732 native_cursor_manager_ = new AshNativeCursorManager; |
| 717 cursor_manager_.reset( | 733 cursor_manager_.reset( |
| 718 new CursorManager(base::WrapUnique(native_cursor_manager_))); | 734 new CursorManager(base::WrapUnique(native_cursor_manager_))); |
| 719 } | 735 } |
| 720 | 736 |
| 721 wm_shell_->delegate()->PreInit(); | 737 shell_delegate_->PreInit(); |
| 722 bool display_initialized = true; | 738 bool display_initialized = true; |
| 723 if (!is_mash) { | 739 if (!is_mash) { |
| 724 display_initialized = display_manager_->InitFromCommandLine(); | 740 display_initialized = display_manager_->InitFromCommandLine(); |
| 725 | 741 |
| 726 display_configuration_controller_.reset(new DisplayConfigurationController( | 742 display_configuration_controller_.reset(new DisplayConfigurationController( |
| 727 display_manager_.get(), window_tree_host_manager_.get())); | 743 display_manager_.get(), window_tree_host_manager_.get())); |
| 728 | 744 |
| 729 #if defined(USE_OZONE) | 745 #if defined(USE_OZONE) |
| 730 display_configurator_->Init( | 746 display_configurator_->Init( |
| 731 ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(), | 747 ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(), |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 base::MakeUnique<LockStateController>(wm_shell_->shutdown_controller()); | 879 base::MakeUnique<LockStateController>(wm_shell_->shutdown_controller()); |
| 864 power_button_controller_.reset( | 880 power_button_controller_.reset( |
| 865 new PowerButtonController(lock_state_controller_.get())); | 881 new PowerButtonController(lock_state_controller_.get())); |
| 866 // Pass the initial display state to PowerButtonController. | 882 // Pass the initial display state to PowerButtonController. |
| 867 power_button_controller_->OnDisplayModeChanged( | 883 power_button_controller_->OnDisplayModeChanged( |
| 868 display_configurator_->cached_displays()); | 884 display_configurator_->cached_displays()); |
| 869 | 885 |
| 870 AddShellObserver(lock_state_controller_.get()); | 886 AddShellObserver(lock_state_controller_.get()); |
| 871 | 887 |
| 872 // The connector is unavailable in some tests. | 888 // The connector is unavailable in some tests. |
| 873 if (is_mash && wm_shell_->delegate()->GetShellConnector()) { | 889 if (is_mash && shell_delegate_->GetShellConnector()) { |
| 874 ui::mojom::UserActivityMonitorPtr user_activity_monitor; | 890 ui::mojom::UserActivityMonitorPtr user_activity_monitor; |
| 875 wm_shell_->delegate()->GetShellConnector()->BindInterface( | 891 shell_delegate_->GetShellConnector()->BindInterface(ui::mojom::kServiceName, |
| 876 ui::mojom::kServiceName, &user_activity_monitor); | 892 &user_activity_monitor); |
| 877 user_activity_forwarder_ = base::MakeUnique<aura::UserActivityForwarder>( | 893 user_activity_forwarder_ = base::MakeUnique<aura::UserActivityForwarder>( |
| 878 std::move(user_activity_monitor), user_activity_detector_.get()); | 894 std::move(user_activity_monitor), user_activity_detector_.get()); |
| 879 } | 895 } |
| 880 | 896 |
| 881 drag_drop_controller_.reset(new DragDropController); | 897 drag_drop_controller_.reset(new DragDropController); |
| 882 // |screenshot_controller_| needs to be created (and prepended as a | 898 // |screenshot_controller_| needs to be created (and prepended as a |
| 883 // pre-target handler) at this point, because |mouse_cursor_filter_| needs to | 899 // pre-target handler) at this point, because |mouse_cursor_filter_| needs to |
| 884 // process mouse events prior to screenshot session. | 900 // process mouse events prior to screenshot session. |
| 885 // See http://crbug.com/459214 | 901 // See http://crbug.com/459214 |
| 886 screenshot_controller_.reset(new ScreenshotController()); | 902 screenshot_controller_.reset(new ScreenshotController()); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 907 | 923 |
| 908 tooltip_controller_.reset(new views::corewm::TooltipController( | 924 tooltip_controller_.reset(new views::corewm::TooltipController( |
| 909 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); | 925 std::unique_ptr<views::corewm::Tooltip>(new views::corewm::TooltipAura))); |
| 910 AddPreTargetHandler(tooltip_controller_.get()); | 926 AddPreTargetHandler(tooltip_controller_.get()); |
| 911 | 927 |
| 912 modality_filter_.reset(new SystemModalContainerEventFilter(this)); | 928 modality_filter_.reset(new SystemModalContainerEventFilter(this)); |
| 913 AddPreTargetHandler(modality_filter_.get()); | 929 AddPreTargetHandler(modality_filter_.get()); |
| 914 | 930 |
| 915 event_client_.reset(new EventClientImpl); | 931 event_client_.reset(new EventClientImpl); |
| 916 | 932 |
| 917 session_state_delegate_.reset( | 933 session_state_delegate_.reset(shell_delegate_->CreateSessionStateDelegate()); |
| 918 wm_shell_->delegate()->CreateSessionStateDelegate()); | |
| 919 // Must occur after Shell has installed its early pre-target handlers (for | 934 // Must occur after Shell has installed its early pre-target handlers (for |
| 920 // example, WindowModalityController). | 935 // example, WindowModalityController). |
| 921 wm_shell_->CreatePointerWatcherAdapter(); | 936 wm_shell_->CreatePointerWatcherAdapter(); |
| 922 | 937 |
| 923 resize_shadow_controller_.reset(new ResizeShadowController()); | 938 resize_shadow_controller_.reset(new ResizeShadowController()); |
| 924 shadow_controller_.reset(new ::wm::ShadowController(focus_controller_.get())); | 939 shadow_controller_.reset(new ::wm::ShadowController(focus_controller_.get())); |
| 925 | 940 |
| 926 wm_shell_->SetSystemTrayDelegate( | 941 wm_shell_->SetSystemTrayDelegate( |
| 927 base::WrapUnique(wm_shell_->delegate()->CreateSystemTrayDelegate())); | 942 base::WrapUnique(shell_delegate_->CreateSystemTrayDelegate())); |
| 928 | 943 |
| 929 // Create AshTouchTransformController before | 944 // Create AshTouchTransformController before |
| 930 // WindowTreeHostManager::InitDisplays() | 945 // WindowTreeHostManager::InitDisplays() |
| 931 // since AshTouchTransformController listens on | 946 // since AshTouchTransformController listens on |
| 932 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). | 947 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). |
| 933 if (!is_mash) { | 948 if (!is_mash) { |
| 934 touch_transformer_controller_.reset(new AshTouchTransformController( | 949 touch_transformer_controller_.reset(new AshTouchTransformController( |
| 935 display_configurator_.get(), display_manager_.get())); | 950 display_configurator_.get(), display_manager_.get())); |
| 936 } | 951 } |
| 937 | 952 |
| 938 if (!is_mash) | 953 if (!is_mash) |
| 939 wm_shell_->SetKeyboardUI(KeyboardUI::Create()); | 954 wm_shell_->SetKeyboardUI(KeyboardUI::Create()); |
| 940 | 955 |
| 941 wm_shell_->InitHosts(init_params); | 956 wm_shell_->InitHosts(init_params); |
| 942 | 957 |
| 943 // Needs to be created after InitDisplays() since it may cause the virtual | 958 // Needs to be created after InitDisplays() since it may cause the virtual |
| 944 // keyboard to be deployed. | 959 // keyboard to be deployed. |
| 945 if (!is_mash) | 960 if (!is_mash) |
| 946 virtual_keyboard_controller_.reset(new VirtualKeyboardController); | 961 virtual_keyboard_controller_.reset(new VirtualKeyboardController); |
| 947 | 962 |
| 948 audio_a11y_controller_.reset(new chromeos::AudioA11yController); | 963 audio_a11y_controller_.reset(new chromeos::AudioA11yController); |
| 949 | 964 |
| 950 // Initialize the wallpaper after the RootWindowController has been created, | 965 // Initialize the wallpaper after the RootWindowController has been created, |
| 951 // otherwise the widget will not paint when restoring after a browser crash. | 966 // otherwise the widget will not paint when restoring after a browser crash. |
| 952 // Also, initialize after display initialization to ensure correct sizing. | 967 // Also, initialize after display initialization to ensure correct sizing. |
| 953 wm_shell_->wallpaper_delegate()->InitializeWallpaper(); | 968 wallpaper_delegate_->InitializeWallpaper(); |
| 954 | 969 |
| 955 if (cursor_manager_) { | 970 if (cursor_manager_) { |
| 956 if (initially_hide_cursor_) | 971 if (initially_hide_cursor_) |
| 957 cursor_manager_->HideCursor(); | 972 cursor_manager_->HideCursor(); |
| 958 cursor_manager_->SetCursor(ui::kCursorPointer); | 973 cursor_manager_->SetCursor(ui::kCursorPointer); |
| 959 } | 974 } |
| 960 | 975 |
| 961 power_event_observer_.reset(new PowerEventObserver()); | 976 power_event_observer_.reset(new PowerEventObserver()); |
| 962 user_activity_notifier_.reset( | 977 user_activity_notifier_.reset( |
| 963 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); | 978 new ui::UserActivityPowerManagerNotifier(user_activity_detector_.get())); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 987 if (keyboard::IsKeyboardEnabled()) { | 1002 if (keyboard::IsKeyboardEnabled()) { |
| 988 if (keyboard::KeyboardController::GetInstance()) { | 1003 if (keyboard::KeyboardController::GetInstance()) { |
| 989 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 1004 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| 990 for (RootWindowControllerList::iterator iter = controllers.begin(); | 1005 for (RootWindowControllerList::iterator iter = controllers.begin(); |
| 991 iter != controllers.end(); ++iter) { | 1006 iter != controllers.end(); ++iter) { |
| 992 (*iter)->DeactivateKeyboard( | 1007 (*iter)->DeactivateKeyboard( |
| 993 keyboard::KeyboardController::GetInstance()); | 1008 keyboard::KeyboardController::GetInstance()); |
| 994 } | 1009 } |
| 995 } | 1010 } |
| 996 keyboard::KeyboardController::ResetInstance( | 1011 keyboard::KeyboardController::ResetInstance( |
| 997 new keyboard::KeyboardController( | 1012 new keyboard::KeyboardController(shell_delegate_->CreateKeyboardUI(), |
| 998 wm_shell_->delegate()->CreateKeyboardUI(), | 1013 virtual_keyboard_controller_.get())); |
| 999 virtual_keyboard_controller_.get())); | |
| 1000 } | 1014 } |
| 1001 } | 1015 } |
| 1002 | 1016 |
| 1003 void Shell::InitRootWindow(aura::Window* root_window) { | 1017 void Shell::InitRootWindow(aura::Window* root_window) { |
| 1004 DCHECK(focus_controller_); | 1018 DCHECK(focus_controller_); |
| 1005 DCHECK(visibility_controller_.get()); | 1019 DCHECK(visibility_controller_.get()); |
| 1006 DCHECK(drag_drop_controller_.get()); | 1020 DCHECK(drag_drop_controller_.get()); |
| 1007 | 1021 |
| 1008 aura::client::SetFocusClient(root_window, focus_controller_.get()); | 1022 aura::client::SetFocusClient(root_window, focus_controller_.get()); |
| 1009 aura::client::SetActivationClient(root_window, focus_controller_.get()); | 1023 aura::client::SetActivationClient(root_window, focus_controller_.get()); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 void Shell::OnWindowActivated( | 1083 void Shell::OnWindowActivated( |
| 1070 aura::client::ActivationChangeObserver::ActivationReason reason, | 1084 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1071 aura::Window* gained_active, | 1085 aura::Window* gained_active, |
| 1072 aura::Window* lost_active) { | 1086 aura::Window* lost_active) { |
| 1073 WmWindow* gained_active_wm = WmWindow::Get(gained_active); | 1087 WmWindow* gained_active_wm = WmWindow::Get(gained_active); |
| 1074 if (gained_active_wm) | 1088 if (gained_active_wm) |
| 1075 root_window_for_new_windows_ = gained_active_wm->GetRootWindow(); | 1089 root_window_for_new_windows_ = gained_active_wm->GetRootWindow(); |
| 1076 } | 1090 } |
| 1077 | 1091 |
| 1078 } // namespace ash | 1092 } // namespace ash |
| OLD | NEW |