use of org.mozilla.focus.tabs.TabView in project Rocket by mozilla-tw.
the class BrowserFragment method capturePage.
public boolean capturePage(@NonNull ScreenshotCallback callback) {
final TabView current = tabsSession.getFocusTab().getTabView();
// Failed to get WebView
if (current == null || !(current instanceof WebView)) {
return false;
}
WebView webView = (WebView) current;
Bitmap content = getPageBitmap(webView);
// Failed to capture
if (content == null) {
return false;
}
callback.onCaptureComplete(current.getTitle(), current.getUrl(), content);
return true;
}
use of org.mozilla.focus.tabs.TabView in project Rocket by mozilla-tw.
the class BrowserFragment method goForward.
public void goForward() {
final TabView current = tabsSession.getFocusTab().getTabView();
if (current != null) {
WebBackForwardList webBackForwardList = ((WebView) current).copyBackForwardList();
WebHistoryItem item = webBackForwardList.getItemAtIndex(webBackForwardList.getCurrentIndex() + 1);
updateURL(item.getUrl());
current.goForward();
}
}
Aggregations