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_controller.h" | 5 #include "ui/views/corewm/focus_controller.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "ui/aura/client/activation_change_observer.h" | 8 #include "ui/aura/client/activation_change_observer.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/focus_change_observer.h" | 10 #include "ui/aura/client/focus_change_observer.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 ui::EventResult FocusController::OnKeyEvent(ui::KeyEvent* event) { | 136 ui::EventResult FocusController::OnKeyEvent(ui::KeyEvent* event) { |
137 return ui::ER_UNHANDLED; | 137 return ui::ER_UNHANDLED; |
138 } | 138 } |
139 | 139 |
140 ui::EventResult FocusController::OnMouseEvent(ui::MouseEvent* event) { | 140 ui::EventResult FocusController::OnMouseEvent(ui::MouseEvent* event) { |
141 if (event->type() == ui::ET_MOUSE_PRESSED) | 141 if (event->type() == ui::ET_MOUSE_PRESSED) |
142 WindowFocusedFromInputEvent(static_cast<aura::Window*>(event->target())); | 142 WindowFocusedFromInputEvent(static_cast<aura::Window*>(event->target())); |
143 return ui::ER_UNHANDLED; | 143 return ui::ER_UNHANDLED; |
144 } | 144 } |
145 | 145 |
146 ui::EventResult FocusController::OnScrollEvent(ui::ScrollEvent* event) { | 146 void FocusController::OnScrollEvent(ui::ScrollEvent* event) { |
147 return ui::ER_UNHANDLED; | |
148 } | 147 } |
149 | 148 |
150 ui::EventResult FocusController::OnTouchEvent(ui::TouchEvent* event) { | 149 void FocusController::OnTouchEvent(ui::TouchEvent* event) { |
151 return ui::ER_UNHANDLED; | |
152 } | 150 } |
153 | 151 |
154 void FocusController::OnGestureEvent(ui::GestureEvent* event) { | 152 void FocusController::OnGestureEvent(ui::GestureEvent* event) { |
155 if (event->type() == ui::ET_GESTURE_BEGIN && | 153 if (event->type() == ui::ET_GESTURE_BEGIN && |
156 event->details().touch_points() == 1) { | 154 event->details().touch_points() == 1) { |
157 WindowFocusedFromInputEvent(static_cast<aura::Window*>(event->target())); | 155 WindowFocusedFromInputEvent(static_cast<aura::Window*>(event->target())); |
158 } | 156 } |
159 } | 157 } |
160 | 158 |
161 //////////////////////////////////////////////////////////////////////////////// | 159 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 SetFocusedWindow(rules_->GetNextFocusableWindow(window)); | 256 SetFocusedWindow(rules_->GetNextFocusableWindow(window)); |
259 } | 257 } |
260 } | 258 } |
261 | 259 |
262 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) { | 260 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) { |
263 FocusWindow(window, NULL); | 261 FocusWindow(window, NULL); |
264 } | 262 } |
265 | 263 |
266 } // namespace corewm | 264 } // namespace corewm |
267 } // namespace views | 265 } // namespace views |
OLD | NEW |