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

Side by Side Diff: ui/chromeos/touch_exploration_controller.cc

Issue 359453003: Added accurate TouchToMouseMode testing to SplitTap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/touch_exploration_controller.h" 5 #include "ui/chromeos/touch_exploration_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "ui/aura/client/cursor_client.h" 9 #include "ui/aura/client/cursor_client.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 if (current_touch_ids_.size() != 1) 495 if (current_touch_ids_.size() != 1)
496 return EVENT_REWRITE_DISCARD; 496 return EVENT_REWRITE_DISCARD;
497 497
498 // Rewrite at location of last touch exploration. 498 // Rewrite at location of last touch exploration.
499 rewritten_event->reset( 499 rewritten_event->reset(
500 new ui::TouchEvent(ui::ET_TOUCH_RELEASED, 500 new ui::TouchEvent(ui::ET_TOUCH_RELEASED,
501 last_touch_exploration_->location(), 501 last_touch_exploration_->location(),
502 initial_press_->touch_id(), 502 initial_press_->touch_id(),
503 event.time_stamp())); 503 event.time_stamp()));
504 (*rewritten_event)->set_flags(event.flags()); 504 (*rewritten_event)->set_flags(event.flags());
505 state_ = TOUCH_EXPLORATION;
505 EnterTouchToMouseMode(); 506 EnterTouchToMouseMode();
506 state_ = TOUCH_EXPLORATION;
507 VLOG_STATE(); 507 VLOG_STATE();
508 return ui::EVENT_REWRITE_REWRITTEN; 508 return ui::EVENT_REWRITE_REWRITTEN;
509 } 509 }
510 NOTREACHED() << "Unexpected event type received: " << event.name(); 510 NOTREACHED() << "Unexpected event type received: " << event.name();
511 return ui::EVENT_REWRITE_CONTINUE; 511 return ui::EVENT_REWRITE_CONTINUE;
512 } 512 }
513 513
514 ui::EventRewriteStatus TouchExplorationController::InWaitForRelease( 514 ui::EventRewriteStatus TouchExplorationController::InWaitForRelease(
515 const ui::TouchEvent& event, 515 const ui::TouchEvent& event,
516 scoped_ptr<ui::Event>* rewritten_event) { 516 scoped_ptr<ui::Event>* rewritten_event) {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 return "TWO_TO_ONE_FINGER"; 723 return "TWO_TO_ONE_FINGER";
724 case PASSTHROUGH: 724 case PASSTHROUGH:
725 return "PASSTHROUGH"; 725 return "PASSTHROUGH";
726 case WAIT_FOR_RELEASE: 726 case WAIT_FOR_RELEASE:
727 return "WAIT_FOR_RELEASE"; 727 return "WAIT_FOR_RELEASE";
728 } 728 }
729 return "Not a state"; 729 return "Not a state";
730 } 730 }
731 731
732 } // namespace ui 732 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698