Commit 826eae68 authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

[Fullscreen Control] Don't show exit UI if slide-down top-chrome is available

If the slide-down top-chrome is available in fullscreen mode then we
don't need to show the fullscreen exit UI since the user can use the
top-chrome to exit fullscreen.

Bug: 758456
Change-Id: I1298279ca97e5fea00629e888e6a56ade23bc67f
Reviewed-on: https://chromium-review.googlesource.com/827608Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524209}
parent bb0cfd5e
......@@ -62,7 +62,7 @@ void FullscreenControlHost::OnMouseEvent(ui::MouseEvent* event) {
return;
}
if (browser_view_->IsFullscreen()) {
if (IsExitUiNeeded()) {
if (IsVisible()) {
float control_bottom = static_cast<float>(
fullscreen_control_popup_.GetFinalBounds().bottom());
......@@ -98,8 +98,8 @@ void FullscreenControlHost::OnTouchEvent(ui::TouchEvent* event) {
}
void FullscreenControlHost::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_LONG_PRESS &&
browser_view_->IsFullscreen() && !IsVisible()) {
if (event->type() == ui::ET_GESTURE_LONG_PRESS && IsExitUiNeeded() &&
!IsVisible()) {
ShowForInputEntryMethod(InputEntryMethod::TOUCH);
}
}
......@@ -132,3 +132,8 @@ void FullscreenControlHost::OnTouchPopupTimeout() {
Hide(true);
}
}
bool FullscreenControlHost::IsExitUiNeeded() {
return browser_view_->IsFullscreen() &&
browser_view_->ShouldHideUIForFullscreen();
}
......@@ -55,6 +55,7 @@ class FullscreenControlHost : public ui::EventHandler {
void ShowForInputEntryMethod(InputEntryMethod input_entry_method);
void OnVisibilityChanged();
void OnTouchPopupTimeout();
bool IsExitUiNeeded();
InputEntryMethod input_entry_method_ = InputEntryMethod::NOT_ACTIVE;
......
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