use of org.chromium.chrome.browser.fullscreen.FullscreenManager in project AndroidChromium by JackyAndroid.
the class TabWebContentsObserver method didNavigateMainFrame.
@Override
public void didNavigateMainFrame(String url, String baseUrl, boolean isNavigationToDifferentPage, boolean isFragmentNavigation, int statusCode) {
FullscreenManager fullscreenManager = mTab.getFullscreenManager();
if (isNavigationToDifferentPage && fullscreenManager != null) {
fullscreenManager.setPersistentFullscreenMode(false);
}
RewindableIterator<TabObserver> observers = mTab.getTabObservers();
while (observers.hasNext()) {
observers.next().onDidNavigateMainFrame(mTab, url, baseUrl, isNavigationToDifferentPage, isFragmentNavigation, statusCode);
}
mTab.stopSwipeRefreshHandler();
}
use of org.chromium.chrome.browser.fullscreen.FullscreenManager in project AndroidChromium by JackyAndroid.
the class Tab method createGestureStateListener.
private GestureStateListener createGestureStateListener() {
return new GestureStateListener() {
@Override
public void onFlingStartGesture(int scrollOffsetY, int scrollExtentY) {
onScrollingStateChanged();
}
@Override
public void onFlingEndGesture(int scrollOffsetY, int scrollExtentY) {
onScrollingStateChanged();
}
@Override
public void onScrollStarted(int scrollOffsetY, int scrollExtentY) {
onScrollingStateChanged();
}
@Override
public void onScrollEnded(int scrollOffsetY, int scrollExtentY) {
onScrollingStateChanged();
}
private void onScrollingStateChanged() {
FullscreenManager fullscreenManager = getFullscreenManager();
if (fullscreenManager == null)
return;
fullscreenManager.onContentViewScrollingStateChanged(getContentViewCore() != null && getContentViewCore().isScrollInProgress());
}
};
}
use of org.chromium.chrome.browser.fullscreen.FullscreenManager in project AndroidChromium by JackyAndroid.
the class Tab method showSadTab.
/**
* Constructs and shows a sad tab (Aw, Snap!).
*/
protected void showSadTab() {
if (getContentViewCore() != null) {
OnClickListener suggestionAction = new OnClickListener() {
@Override
public void onClick(View view) {
Activity activity = mWindowAndroid.getActivity().get();
assert activity != null;
HelpAndFeedback.getInstance(activity).show(activity, activity.getString(R.string.help_context_sad_tab), Profile.getLastUsedProfile(), null);
}
};
OnClickListener reloadButtonAction = new OnClickListener() {
@Override
public void onClick(View view) {
reload();
}
};
// Make sure we are not adding the "Aw, snap" view over an existing one.
assert mSadTabView == null;
mSadTabView = SadTabViewFactory.createSadTabView(mThemedApplicationContext, suggestionAction, reloadButtonAction);
// Show the sad tab inside ContentView.
getContentViewCore().getContainerView().addView(mSadTabView, new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
notifyContentChanged();
}
FullscreenManager fullscreenManager = getFullscreenManager();
if (fullscreenManager != null) {
fullscreenManager.setPositionsForTabToNonFullscreen();
}
}
use of org.chromium.chrome.browser.fullscreen.FullscreenManager in project AndroidChromium by JackyAndroid.
the class TabWebContentsDelegateAndroid method getContentVideoViewEmbedder.
@Override
public ContentVideoViewEmbedder getContentVideoViewEmbedder() {
return new ActivityContentVideoViewEmbedder(mTab.getActivity()) {
@Override
public void enterFullscreenVideo(View view, boolean isVideoLoaded) {
super.enterFullscreenVideo(view, isVideoLoaded);
FullscreenManager fullscreenManager = mTab.getFullscreenManager();
if (fullscreenManager != null) {
fullscreenManager.setOverlayVideoMode(true);
// Disable double tap for video.
ContentViewCore cvc = mTab.getContentViewCore();
if (cvc != null) {
cvc.updateDoubleTapSupport(false);
}
}
}
@Override
public void exitFullscreenVideo() {
FullscreenManager fullscreenManager = mTab.getFullscreenManager();
if (fullscreenManager != null) {
fullscreenManager.setOverlayVideoMode(false);
// Disable double tap for video.
ContentViewCore cvc = mTab.getContentViewCore();
if (cvc != null) {
cvc.updateDoubleTapSupport(true);
}
}
super.exitFullscreenVideo();
}
};
}
Aggregations