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

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

Issue 2553253002: [Android History] Add support for opening items (Closed)
Patch Set: Changes from dfalcantara@ review Created 4 years 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/HistoryItem.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java
index a68f650f3dc8d6e7c53d60bd92cd63dc745eeaf2..3ddc16ec13e272b22af504aa81151e9b86c63020 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItem.java
@@ -16,6 +16,8 @@ public class HistoryItem extends TimedItem {
private final long mTimestamp;
private Long mStableId;
+ private HistoryManager mManager;
+
/**
* @param url The url for this item.
* @param domain The string to display for the item's domain.
@@ -29,6 +31,11 @@ public class HistoryItem extends TimedItem {
mTimestamp = timestamp;
}
+ /** @return The url for this item. */
+ public String getUrl() {
+ return mUrl;
+ }
+
/** @return The string to display for the item's domain. */
public String getDomain() {
return mDomain;
@@ -53,4 +60,18 @@ public class HistoryItem extends TimedItem {
}
return mStableId;
}
+
+ /**
+ * @param manager The HistoryManager associated with this item.
+ */
+ public void setHistoryManager(HistoryManager manager) {
+ mManager = manager;
+ }
+
+ /**
+ * Navigates a tab to this item's URL.
+ */
+ public void open() {
+ if (mManager != null) mManager.openItem(mUrl, null, false);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698