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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 | 158 |
159 ui::EventResult DesktopActivationClient::OnScrollEvent(ui::ScrollEvent* event) { | 159 ui::EventResult DesktopActivationClient::OnScrollEvent(ui::ScrollEvent* event) { |
160 return ui::ER_UNHANDLED; | 160 return ui::ER_UNHANDLED; |
161 } | 161 } |
162 | 162 |
163 ui::EventResult DesktopActivationClient::OnTouchEvent(ui::TouchEvent* event) { | 163 ui::EventResult DesktopActivationClient::OnTouchEvent(ui::TouchEvent* event) { |
164 return ui::ER_UNHANDLED; | 164 return ui::ER_UNHANDLED; |
165 } | 165 } |
166 | 166 |
167 ui::EventResult DesktopActivationClient::OnGestureEvent( | 167 void DesktopActivationClient::OnGestureEvent(ui::GestureEvent* event) { |
168 ui::GestureEvent* event) { | |
169 if (event->type() == ui::ET_GESTURE_BEGIN && | 168 if (event->type() == ui::ET_GESTURE_BEGIN && |
170 event->details().touch_points() == 1) { | 169 event->details().touch_points() == 1) { |
171 FocusWindowWithEvent(event); | 170 FocusWindowWithEvent(event); |
172 } | 171 } |
173 return ui::ER_UNHANDLED; | |
174 } | 172 } |
175 | 173 |
176 void DesktopActivationClient::FocusWindowWithEvent(const ui::Event* event) { | 174 void DesktopActivationClient::FocusWindowWithEvent(const ui::Event* event) { |
177 aura::Window* window = static_cast<aura::Window*>(event->target()); | 175 aura::Window* window = static_cast<aura::Window*>(event->target()); |
178 if (GetActiveWindow() != window) { | 176 if (GetActiveWindow() != window) { |
179 aura::client::GetFocusClient(window)->FocusWindow( | 177 aura::client::GetFocusClient(window)->FocusWindow( |
180 FindFocusableWindowFor(window), event); | 178 FindFocusableWindowFor(window), event); |
181 } | 179 } |
182 } | 180 } |
183 | 181 |
184 } // namespace views | 182 } // namespace views |
OLD | NEW |