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 "ui/views/corewm/activation_change_shim.h" | 5 #include "ui/views/corewm/activation_change_shim.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 #include "ui/base/events/event_target.h" | 9 #include "ui/base/events/event_target.h" |
10 #include "ui/views/corewm/corewm_switches.h" | 10 #include "ui/views/corewm/corewm_switches.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 ActivationChangeShim::~ActivationChangeShim() { | 28 ActivationChangeShim::~ActivationChangeShim() { |
29 if (UseFocusController() && target_) | 29 if (UseFocusController() && target_) |
30 target_->RemovePreTargetHandler(this); | 30 target_->RemovePreTargetHandler(this); |
31 } | 31 } |
32 | 32 |
33 void ActivationChangeShim::OnWindowActivated(aura::Window* active, | 33 void ActivationChangeShim::OnWindowActivated(aura::Window* active, |
34 aura::Window* old_active) { | 34 aura::Window* old_active) { |
35 } | 35 } |
36 | 36 |
37 ui::EventResult ActivationChangeShim::OnEvent(ui::Event* event) { | 37 void ActivationChangeShim::OnEvent(ui::Event* event) { |
38 if (event->type() == FocusChangeEvent::activation_changed_event_type()) { | 38 if (event->type() == FocusChangeEvent::activation_changed_event_type()) { |
39 DCHECK(UseFocusController()); | 39 DCHECK(UseFocusController()); |
40 FocusChangeEvent* fce = static_cast<FocusChangeEvent*>(event); | 40 FocusChangeEvent* fce = static_cast<FocusChangeEvent*>(event); |
41 OnWindowActivated(static_cast<aura::Window*>(event->target()), | 41 OnWindowActivated(static_cast<aura::Window*>(event->target()), |
42 static_cast<aura::Window*>(fce->last_focus())); | 42 static_cast<aura::Window*>(fce->last_focus())); |
43 } | 43 } |
44 return EventHandler::OnEvent(event); | 44 EventHandler::OnEvent(event); |
45 } | 45 } |
46 | 46 |
47 } // namespace corewm | 47 } // namespace corewm |
48 } // namespace views | 48 } // namespace views |
OLD | NEW |