Commit dbfbe57e authored by Ryan Daum's avatar Ryan Daum Committed by Commit Bot

[chromecast] Notify applications about ongoing back gesture.

Adds a new method, "GestureProgress" to CastContentWindow::Delegate's
interface which can be used to pass on to the application the
knowledge of an ongoing system gesture.

Bug: internal b/109888887
Test: manual
Change-Id: I4db39537274e16bcb35f84013cc01a71e7c14f3e
Reviewed-on: https://chromium-review.googlesource.com/1093025Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Commit-Queue: Ryan Daum <rdaum@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565774}
parent 2125f897
...@@ -39,8 +39,12 @@ void CastBackGestureDispatcher::HandleSideSwipeBegin( ...@@ -39,8 +39,12 @@ void CastBackGestureDispatcher::HandleSideSwipeBegin(
void CastBackGestureDispatcher::HandleSideSwipeContinue( void CastBackGestureDispatcher::HandleSideSwipeContinue(
CastSideSwipeOrigin swipe_origin, CastSideSwipeOrigin swipe_origin,
const gfx::Point& touch_location) { const gfx::Point& touch_location) {
if (!dispatched_back_ && swipe_origin == CastSideSwipeOrigin::LEFT && if (swipe_origin != CastSideSwipeOrigin::LEFT) {
touch_location.x() >= horizontal_threshold_) { return;
}
delegate_->GestureProgress(GestureType::GO_BACK, touch_location);
if (!dispatched_back_ && touch_location.x() >= horizontal_threshold_) {
dispatched_back_ = true; dispatched_back_ = true;
delegate_->ConsumeGesture(GestureType::GO_BACK); delegate_->ConsumeGesture(GestureType::GO_BACK);
} }
......
...@@ -83,8 +83,12 @@ class CastContentWindow { ...@@ -83,8 +83,12 @@ class CastContentWindow {
// called prior to ConsumeGesture(). // called prior to ConsumeGesture().
virtual bool CanHandleGesture(GestureType gesture_type) = 0; virtual bool CanHandleGesture(GestureType gesture_type) = 0;
// Consume and handle a UI gesture. Returns whether the gesture was // Called while a system UI gesture is in progress.
// handled or not. virtual void GestureProgress(GestureType gesture_type,
const gfx::Point& touch_location){};
// Consume and handle a completed UI gesture. Returns whether the gesture
// was handled or not.
virtual bool ConsumeGesture(GestureType gesture_type) = 0; virtual bool ConsumeGesture(GestureType gesture_type) = 0;
// Notify visibility change for this window. // Notify visibility change for this window.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment