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/widget/desktop_aura/desktop_activation_client.h" | 5 #include "ui/views/widget/desktop_aura/desktop_activation_client.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/aura/client/activation_delegate.h" | 9 #include "ui/aura/client/activation_delegate.h" |
10 #include "ui/aura/client/activation_change_observer.h" | 10 #include "ui/aura/client/activation_change_observer.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 ui::EventResult DesktopActivationClient::OnKeyEvent(ui::KeyEvent* event) { | 161 ui::EventResult DesktopActivationClient::OnKeyEvent(ui::KeyEvent* event) { |
162 return ui::ER_UNHANDLED; | 162 return ui::ER_UNHANDLED; |
163 } | 163 } |
164 | 164 |
165 ui::EventResult DesktopActivationClient::OnMouseEvent(ui::MouseEvent* event) { | 165 ui::EventResult DesktopActivationClient::OnMouseEvent(ui::MouseEvent* event) { |
166 if (event->type() == ui::ET_MOUSE_PRESSED) | 166 if (event->type() == ui::ET_MOUSE_PRESSED) |
167 FocusWindowWithEvent(event); | 167 FocusWindowWithEvent(event); |
168 return ui::ER_UNHANDLED; | 168 return ui::ER_UNHANDLED; |
169 } | 169 } |
170 | 170 |
171 ui::EventResult DesktopActivationClient::OnScrollEvent(ui::ScrollEvent* event) { | 171 void DesktopActivationClient::OnScrollEvent(ui::ScrollEvent* event) { |
172 return ui::ER_UNHANDLED; | |
173 } | 172 } |
174 | 173 |
175 ui::EventResult DesktopActivationClient::OnTouchEvent(ui::TouchEvent* event) { | 174 void DesktopActivationClient::OnTouchEvent(ui::TouchEvent* event) { |
176 return ui::ER_UNHANDLED; | |
177 } | 175 } |
178 | 176 |
179 void DesktopActivationClient::OnGestureEvent(ui::GestureEvent* event) { | 177 void DesktopActivationClient::OnGestureEvent(ui::GestureEvent* event) { |
180 if (event->type() == ui::ET_GESTURE_BEGIN && | 178 if (event->type() == ui::ET_GESTURE_BEGIN && |
181 event->details().touch_points() == 1) { | 179 event->details().touch_points() == 1) { |
182 FocusWindowWithEvent(event); | 180 FocusWindowWithEvent(event); |
183 } | 181 } |
184 } | 182 } |
185 | 183 |
186 void DesktopActivationClient::FocusWindowWithEvent(const ui::Event* event) { | 184 void DesktopActivationClient::FocusWindowWithEvent(const ui::Event* event) { |
187 aura::Window* window = static_cast<aura::Window*>(event->target()); | 185 aura::Window* window = static_cast<aura::Window*>(event->target()); |
188 if (GetActiveWindow() != window) { | 186 if (GetActiveWindow() != window) { |
189 aura::client::GetFocusClient(window)->FocusWindow( | 187 aura::client::GetFocusClient(window)->FocusWindow( |
190 FindFocusableWindowFor(window), event); | 188 FindFocusableWindowFor(window), event); |
191 } | 189 } |
192 } | 190 } |
193 | 191 |
194 } // namespace views | 192 } // namespace views |
OLD | NEW |