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

Side by Side Diff: ui/aura/test/event_generator.cc

Issue 143023003: Fully support the autohide shelf option for touch UI on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile out edge swipe code on non-Windows, and add tests. Created 6 years, 10 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
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 "ui/aura/test/event_generator.h" 5 #include "ui/aura/test/event_generator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "ui/aura/client/screen_position_client.h" 10 #include "ui/aura/client/screen_position_client.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 void EventGenerator::PressMoveAndReleaseTouchTo(const gfx::Point& point) { 241 void EventGenerator::PressMoveAndReleaseTouchTo(const gfx::Point& point) {
242 PressTouch(); 242 PressTouch();
243 MoveTouch(point); 243 MoveTouch(point);
244 ReleaseTouch(); 244 ReleaseTouch();
245 } 245 }
246 246
247 void EventGenerator::PressMoveAndReleaseTouchToCenterOf(Window* window) { 247 void EventGenerator::PressMoveAndReleaseTouchToCenterOf(Window* window) {
248 PressMoveAndReleaseTouchTo(CenterOfWindow(window)); 248 PressMoveAndReleaseTouchTo(CenterOfWindow(window));
249 } 249 }
250 250
251 #if defined(OS_WIN)
252 void EventGenerator::GestureEdgeSwipe() {
253 ui::GestureEvent gesture(
254 ui::ET_GESTURE_WIN8_EDGE_SWIPE,
255 0,
256 0,
257 0,
258 ui::EventTimeForNow(),
259 ui::GestureEventDetails(ui::ET_GESTURE_WIN8_EDGE_SWIPE, 0, 0),
260 0);
261 Dispatch(&gesture);
262 }
263 #endif
264
251 void EventGenerator::GestureTapAt(const gfx::Point& location) { 265 void EventGenerator::GestureTapAt(const gfx::Point& location) {
252 const int kTouchId = 2; 266 const int kTouchId = 2;
253 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, 267 ui::TouchEvent press(ui::ET_TOUCH_PRESSED,
254 location, 268 location,
255 kTouchId, 269 kTouchId,
256 ui::EventTimeForNow()); 270 ui::EventTimeForNow());
257 Dispatch(&press); 271 Dispatch(&press);
258 272
259 ui::TouchEvent release( 273 ui::TouchEvent release(
260 ui::ET_TOUCH_RELEASED, location, kTouchId, 274 ui::ET_TOUCH_RELEASED, location, kTouchId,
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 base::MessageLoopProxy::current()->PostTask( 625 base::MessageLoopProxy::current()->PostTask(
612 FROM_HERE, 626 FROM_HERE,
613 base::Bind(&EventGenerator::DispatchNextPendingEvent, 627 base::Bind(&EventGenerator::DispatchNextPendingEvent,
614 base::Unretained(this))); 628 base::Unretained(this)));
615 } 629 }
616 } 630 }
617 631
618 632
619 } // namespace test 633 } // namespace test
620 } // namespace aura 634 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698