Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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.
Jump to
Jump to file
Failed to load files.
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