mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
alloy: views: mac: Add three-finger-swipe navigation gesture support
This adds support for the three-finger-swipe navigation gesture with Alloy/Views. The default implementation matches the Chrome runtime and navigates the browser back/forward. We also add an Alloy/Views- specific client callback in CefBrowserViewDelegate for optional custom handling of the gesture event.
This commit is contained in:
committed by
Marshall Greenblatt
parent
8ff65ec09f
commit
f3083218af
@@ -218,6 +218,23 @@ void CefBrowserViewImpl::OnBoundsChanged() {
|
||||
}
|
||||
}
|
||||
|
||||
void CefBrowserViewImpl::OnGestureCommand(cef_gesture_command_t command) {
|
||||
if (delegate()->OnGestureCommand(this, command)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (browser_) {
|
||||
switch (command) {
|
||||
case CEF_GESTURE_COMMAND_BACK:
|
||||
browser_->GoBack();
|
||||
break;
|
||||
case CEF_GESTURE_COMMAND_FORWARD:
|
||||
browser_->GoForward();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CefBrowserViewImpl::CefBrowserViewImpl(
|
||||
CefRefPtr<CefBrowserViewDelegate> delegate)
|
||||
: ParentClass(delegate), weak_ptr_factory_(this) {}
|
||||
|
Reference in New Issue
Block a user