diff options
Diffstat (limited to 'ash/shell.cc')
-rw-r--r-- | ash/shell.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index de1721d..1651251 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -87,7 +87,6 @@ #include "ui/ui_controls/ui_controls.h" #include "ui/views/corewm/compound_event_filter.h" #include "ui/views/corewm/corewm_switches.h" -#include "ui/views/corewm/focus_change_event.h" #include "ui/views/corewm/focus_controller.h" #include "ui/views/corewm/input_method_event_filter.h" #include "ui/views/corewm/shadow_controller.h" @@ -414,6 +413,7 @@ void Shell::Init() { new views::corewm::FocusController(new wm::AshFocusRules); focus_client_.reset(focus_controller); activation_client_ = focus_controller; + activation_client_->AddObserver(this); } else { focus_client_.reset(new aura::FocusManager); activation_controller_.reset( @@ -891,11 +891,14 @@ ui::EventTarget* Shell::GetParentTarget() { } void Shell::OnEvent(ui::Event* event) { - if (event->type() == - views::corewm::FocusChangeEvent::activation_changed_event_type()) { - active_root_window_ = - static_cast<aura::Window*>(event->target())->GetRootWindow(); - } +} + +//////////////////////////////////////////////////////////////////////////////// +// Shell, aura::client::ActivationChangeObserver implementation: + +void Shell::OnWindowActivated(aura::Window* gained_active, + aura::Window* lost_active) { + active_root_window_ = gained_active->GetRootWindow(); } } // namespace ash |