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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java

Issue 2861453002: [Home] Update util methods to open bookmarks/downloads/history (Closed)
Patch Set: [Home] Update util methods to open bookmarks/downloads/history Created 3 years, 8 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
Index: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java
index 135d741ae7026ceb386d12167a518d914b21eb64..3ce75297f827d5150b88350b0261472815b99db7 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java
@@ -4,11 +4,12 @@
package org.chromium.chrome.browser.history;
-import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import org.chromium.base.ContextUtils;
+import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.UrlConstants;
@@ -38,16 +39,22 @@ public class HistoryManagerUtils {
}
/**
- * Opens the browsing history manager.
- */
- public static void showHistoryManager(Activity activity, Tab tab) {
+ * Opens the browsing history manager.
+ *
+ * @param activity The {@link ChromeActivity} that owns the {@link HistoryManager}.
+ * @param tab The {@link Tab} to used to display the native page version of the
+ * {@link HistoryManager}.
+ */
+ public static void showHistoryManager(ChromeActivity activity, Tab tab) {
if (!isAndroidHistoryManagerEnabled()) {
tab.loadUrl(new LoadUrlParams(UrlConstants.HISTORY_URL, PageTransition.AUTO_TOPLEVEL));
return;
}
Context appContext = ContextUtils.getApplicationContext();
- if (DeviceFormFactor.isTablet(appContext)) {
+ if (activity.getBottomSheet() != null) {
+ activity.getBottomSheetContentController().showContentAndOpenSheet(R.id.action_history);
+ } else if (DeviceFormFactor.isTablet(appContext)) {
// History shows up as a tab on tablets.
LoadUrlParams params = new LoadUrlParams(UrlConstants.NATIVE_HISTORY_URL);
tab.loadUrl(params);

Powered by Google App Engine
This is Rietveld 408576698