Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: ash/wm/gestures/long_press_affordance_handler.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/gestures/bezel_gesture_handler.cc ('k') | ash/wm/maximize_bubble_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/wm/gestures/bezel_gesture_handler.cc ('k') | ash/wm/maximize_bubble_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698