Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Only load home page if session uri is blank on new intent. #3545

Merged
merged 1 commit into from
Jun 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ void loadFromIntent(final Intent intent) {
}
mWindows.openNewTabAfterRestore(uri.toString(), location);
} else {
mWindows.getFocusedWindow().loadHomeIfNotRestored();
mWindows.getFocusedWindow().loadHomeIfBlank();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public class WindowWidget extends UIWidget implements SessionChangeListener,
private Windows.WindowPlacement mWindowPlacement = Windows.WindowPlacement.FRONT;
private Windows.WindowPlacement mWindowPlacementBeforeFullscreen = Windows.WindowPlacement.FRONT;
private float mMaxWindowScale = 3;
private boolean mIsRestored = false;
private CopyOnWriteArrayList<WindowListener> mListeners;
boolean mActive = false;
boolean mHovered = false;
Expand Down Expand Up @@ -382,8 +381,9 @@ public void close() {
mListeners.clear();
}

public void loadHomeIfNotRestored() {
if (!mIsRestored) {
public void loadHomeIfBlank() {
final String currentUri = mSession.getCurrentUri();
if ((currentUri == null) || currentUri.isEmpty() || UrlUtils.isBlankUri(getContext(), mSession.getCurrentUri())) {
loadHome();
}
}
Expand All @@ -397,10 +397,6 @@ public void loadHome() {
}
}

protected void setRestored(boolean restored) {
mIsRestored = restored;
}

private void setView(View view, boolean switchSurface) {
Runnable setView = () -> {
if (switchSurface) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ private WindowWidget addRestoredWindow(@NonNull WindowState aState, @Nullable Se
newWindow.getPlacement().width = aState.textureWidth;
newWindow.getPlacement().height = aState.textureHeight;
newWindow.getPlacement().worldWidth = aState.worldWidth;
newWindow.setRestored(true);
placeWindow(newWindow, aState.placement);
if (newWindow.getSession() != null) {
if (aState.panelType != null) {
Expand Down