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 "ash/wm/gestures/long_press_affordance_handler.h" | 5 #include "ash/wm/gestures/long_press_affordance_handler.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 if (tap_down_touch_id_ != -1 && tap_down_touch_id_ != touch_id) | 254 if (tap_down_touch_id_ != -1 && tap_down_touch_id_ != touch_id) |
255 return; | 255 return; |
256 int64 timer_start_time_ms = | 256 int64 timer_start_time_ms = |
257 ui::GestureConfiguration::semi_long_press_time_in_seconds() * 1000; | 257 ui::GestureConfiguration::semi_long_press_time_in_seconds() * 1000; |
258 switch (event->type()) { | 258 switch (event->type()) { |
259 case ui::ET_GESTURE_TAP_DOWN: | 259 case ui::ET_GESTURE_TAP_DOWN: |
260 // Start animation. | 260 // Start animation. |
261 tap_down_location_ = event->root_location(); | 261 tap_down_location_ = event->root_location(); |
262 tap_down_touch_id_ = touch_id; | 262 tap_down_touch_id_ = touch_id; |
263 current_animation_type_ = GROW_ANIMATION; | 263 current_animation_type_ = GROW_ANIMATION; |
264 tap_down_display_id_ = gfx::Screen::GetDisplayNearestWindow(target).id(); | 264 tap_down_display_id_ = |
| 265 Shell::GetScreen()->GetDisplayNearestWindow(target).id(); |
265 timer_.Start(FROM_HERE, | 266 timer_.Start(FROM_HERE, |
266 base::TimeDelta::FromMilliseconds(timer_start_time_ms), | 267 base::TimeDelta::FromMilliseconds(timer_start_time_ms), |
267 this, | 268 this, |
268 &LongPressAffordanceHandler::StartAnimation); | 269 &LongPressAffordanceHandler::StartAnimation); |
269 break; | 270 break; |
270 case ui::ET_TOUCH_MOVED: | 271 case ui::ET_TOUCH_MOVED: |
271 // If animation is running, We want it to be robust to small finger | 272 // If animation is running, We want it to be robust to small finger |
272 // movements. So we stop the animation only when the finger moves a | 273 // movements. So we stop the animation only when the finger moves a |
273 // certain distance. | 274 // certain distance. |
274 if (!ui::gestures::IsInsideManhattanSquare( | 275 if (!ui::gestures::IsInsideManhattanSquare( |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 default: | 369 default: |
369 view_.reset(); | 370 view_.reset(); |
370 tap_down_touch_id_ = -1; | 371 tap_down_touch_id_ = -1; |
371 tap_down_display_id_ = 0; | 372 tap_down_display_id_ = 0; |
372 break; | 373 break; |
373 } | 374 } |
374 } | 375 } |
375 | 376 |
376 } // namespace internal | 377 } // namespace internal |
377 } // namespace ash | 378 } // namespace ash |
OLD | NEW |