Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
haanhvu committed Dec 5, 2024
1 parent 6d29be0 commit 8e0b329
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ private void updateUI() {
if (getSession().canGoBack()) {
getSession().goBack();
} else if (mViewModel.getBackToNewTabEnabled().getValue().get()) {
//mAttachedWindow.showNewTab();
getSession().loadUri("about://newtab");
getSession().loadUri(UrlUtils.ABOUT_NEWTAB);
}

if (mAudio != null) {
Expand All @@ -257,8 +256,6 @@ private void updateUI() {
mBinding.navigationBarNavigation.forwardButton.setOnClickListener(v -> {
v.requestFocusFromTouch();
if (mViewModel.getCanGoForwardFromNewTab().getValue().get()) {
//mAttachedWindow.hideNewTab();

String forwardUrl = mViewModel.getUrlForwardFromNewTab().getValue().toString();
getSession().loadUri(forwardUrl);

Expand All @@ -273,7 +270,7 @@ private void updateUI() {
if (mAudio != null) {
mAudio.playSound(AudioEngine.Sound.CLICK);
}
//mNavigationListeners.forEach(NavigationListener::onForward);
mNavigationListeners.forEach(NavigationListener::onForward);
});

mBinding.navigationBarNavigation.reloadButton.setOnClickListener(v -> {
Expand Down Expand Up @@ -1036,7 +1033,10 @@ public void onLocationChange(@NonNull WSession session, @Nullable String url) {
updateTrackingProtection();
}

mBinding.navigationBarNavigation.reloadButton.setEnabled(mViewModel.getCurrentContentType().getValue() != Windows.ContentType.NEW_TAB && !UrlUtils.isPrivateAboutPage(getContext(), url));
mBinding.navigationBarNavigation.reloadButton.setEnabled(
mViewModel.getCurrentContentType().getValue() != Windows.ContentType.NEW_TAB
&& !mViewModel.getIsNativeContentVisible().getValue().get()
&& !UrlUtils.isPrivateAboutPage(getContext(), url));
}

// Content delegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,9 @@ public void load(@NonNull WindowWidget aWindow, WindowsState aState, int aTabInd
worldWidth = widgetPlacement.worldWidth;
tabIndex = aTabIndex;
if (aWindow.isNativeContentVisible()) {
if (aWindow.getCurrentContentType() == ContentType.NEW_TAB) {
contentType = ContentType.NEW_TAB;
} else {
contentType = aWindow.getSelectedPanel();
}
contentType = aWindow.getSelectedPanel();
} else if (aWindow.getCurrentContentType() == ContentType.NEW_TAB) {
contentType = ContentType.NEW_TAB;
} else {
contentType = ContentType.WEB_CONTENT;
}
Expand Down

0 comments on commit 8e0b329

Please sign in to comment.