| 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" |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 display_initialized = true; | 700 display_initialized = true; |
| 701 } | 701 } |
| 702 #endif // defined(OS_CHROMEOS) && defined(USE_X11) | 702 #endif // defined(OS_CHROMEOS) && defined(USE_X11) |
| 703 if (!display_initialized) | 703 if (!display_initialized) |
| 704 display_manager_->InitFromCommandLine(); | 704 display_manager_->InitFromCommandLine(); |
| 705 | 705 |
| 706 // Install the custom factory first so that views::FocusManagers for Tray, | 706 // Install the custom factory first so that views::FocusManagers for Tray, |
| 707 // Launcher, and WallPaper could be created by the factory. | 707 // Launcher, and WallPaper could be created by the factory. |
| 708 views::FocusManagerFactory::Install(new AshFocusManagerFactory); | 708 views::FocusManagerFactory::Install(new AshFocusManagerFactory); |
| 709 | 709 |
| 710 // Env creates the compositor. Historically it seems to have been implicitly |
| 711 // initialized first by the ActivationController, but now that FocusController |
| 712 // no longer does this we need to do it explicitly. |
| 713 aura::Env::CreateInstance(); |
| 714 |
| 710 // The WindowModalityController needs to be at the front of the input event | 715 // The WindowModalityController needs to be at the front of the input event |
| 711 // pretarget handler list to ensure that it processes input events when modal | 716 // pretarget handler list to ensure that it processes input events when modal |
| 712 // windows are active. | 717 // windows are active. |
| 713 window_modality_controller_.reset( | 718 window_modality_controller_.reset( |
| 714 new views::corewm::WindowModalityController(this)); | 719 new views::corewm::WindowModalityController(this)); |
| 715 | 720 |
| 716 AddPreTargetHandler(this); | 721 AddPreTargetHandler(this); |
| 717 | 722 |
| 718 env_filter_.reset(new views::corewm::CompoundEventFilter); | 723 env_filter_.reset(new views::corewm::CompoundEventFilter); |
| 719 AddPreTargetHandler(env_filter_.get()); | 724 AddPreTargetHandler(env_filter_.get()); |
| 720 | 725 |
| 721 // Env creates the compositor. Historically it seems to have been implicitly | |
| 722 // initialized first by the ActivationController, but now that FocusController | |
| 723 // no longer does this we need to do it explicitly. | |
| 724 aura::Env::GetInstance(); | |
| 725 views::corewm::FocusController* focus_controller = | 726 views::corewm::FocusController* focus_controller = |
| 726 new views::corewm::FocusController(new wm::AshFocusRules); | 727 new views::corewm::FocusController(new wm::AshFocusRules); |
| 727 focus_client_.reset(focus_controller); | 728 focus_client_.reset(focus_controller); |
| 728 activation_client_ = focus_controller; | 729 activation_client_ = focus_controller; |
| 729 activation_client_->AddObserver(this); | 730 activation_client_->AddObserver(this); |
| 730 focus_cycler_.reset(new internal::FocusCycler()); | 731 focus_cycler_.reset(new internal::FocusCycler()); |
| 731 | 732 |
| 732 screen_position_controller_.reset(new internal::ScreenPositionController); | 733 screen_position_controller_.reset(new internal::ScreenPositionController); |
| 733 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory()); | 734 root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory()); |
| 734 | 735 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 //////////////////////////////////////////////////////////////////////////////// | 966 //////////////////////////////////////////////////////////////////////////////// |
| 966 // Shell, aura::client::ActivationChangeObserver implementation: | 967 // Shell, aura::client::ActivationChangeObserver implementation: |
| 967 | 968 |
| 968 void Shell::OnWindowActivated(aura::Window* gained_active, | 969 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 969 aura::Window* lost_active) { | 970 aura::Window* lost_active) { |
| 970 if (gained_active) | 971 if (gained_active) |
| 971 target_root_window_ = gained_active->GetRootWindow(); | 972 target_root_window_ = gained_active->GetRootWindow(); |
| 972 } | 973 } |
| 973 | 974 |
| 974 } // namespace ash | 975 } // namespace ash |
| OLD | NEW |