| 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/focus_change_shim.h" | 5 #include "ui/views/corewm/focus_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 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 FocusChangeShim::~FocusChangeShim() { | 28 FocusChangeShim::~FocusChangeShim() { |
| 29 if (UseFocusController() && target_) | 29 if (UseFocusController() && target_) |
| 30 target_->RemovePreTargetHandler(this); | 30 target_->RemovePreTargetHandler(this); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void FocusChangeShim::OnWindowFocused(aura::Window* window) { | 33 void FocusChangeShim::OnWindowFocused(aura::Window* window) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 ui::EventResult FocusChangeShim::OnEvent(ui::Event* event) { | 36 void FocusChangeShim::OnEvent(ui::Event* event) { |
| 37 if (event->type() == FocusChangeEvent::focus_changed_event_type()) { | 37 if (event->type() == FocusChangeEvent::focus_changed_event_type()) { |
| 38 DCHECK(UseFocusController()); | 38 DCHECK(UseFocusController()); |
| 39 OnWindowFocused(static_cast<aura::Window*>(event->target())); | 39 OnWindowFocused(static_cast<aura::Window*>(event->target())); |
| 40 } | 40 } |
| 41 return EventHandler::OnEvent(event); | 41 EventHandler::OnEvent(event); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace corewm | 44 } // namespace corewm |
| 45 } // namespace views | 45 } // namespace views |
| OLD | NEW |