Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4109)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java

Issue 2710323003: 🏠 Close the bottom sheet when opening link in incognito (Closed)
Patch Set: Properly make ContentSuggestionsActivity compile Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java
index f720732fb475fb45fd2f1fc655fde1ef59cc2e62..8cb6a121b608d71999878be8750feb9f05f6971e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java
@@ -392,11 +392,11 @@ public void onLayoutChange(View v, int left, int top, int right, int bottom,
}
@Override
- public int loadUrl(LoadUrlParams params) {
+ public int loadUrl(LoadUrlParams params, boolean incognito) {
for (BottomSheetObserver o : mObservers) o.onLoadUrl(params.getUrl());
// Native page URLs in this context do not need to communicate with the tab.
- if (NativePageFactory.isNativePageUrl(params.getUrl(), isIncognito())) {
+ if (NativePageFactory.isNativePageUrl(params.getUrl(), incognito)) {
return TabLoadStatus.PAGE_LOAD_FAILED;
}
@@ -406,13 +406,13 @@ public int loadUrl(LoadUrlParams params) {
assert mTabModelSelector != null;
// First try to get the tab behind the sheet.
- if (mTabModelSelector.getCurrentTab() != null) {
- return mTabModelSelector.getCurrentTab().loadUrl(params);
+ if (getActiveTab() != null && getActiveTab().isIncognito() == incognito) {
+ return getActiveTab().loadUrl(params);
}
- // If no tab is active behind the sheet, open a new one.
+ // If no compatible tab is active behind the sheet, open a new one.
mTabModelSelector.openNewTab(
- params, TabModel.TabLaunchType.FROM_CHROME_UI, null, isIncognito());
+ params, TabModel.TabLaunchType.FROM_CHROME_UI, getActiveTab(), incognito);
return TabLoadStatus.DEFAULT_PAGE_LOAD;
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698