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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedItem.java

Issue 1721753002: [Offline pages on the NTP] Add UMA for offline-available NTP tiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedItem.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedItem.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedItem.java
index 64b6b0cfb128e7a55382edf5c7c23433cbf02ddd..3e83b9e264149fb990bfd8a9dcc46afb3ca03d35 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedItem.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedItem.java
@@ -49,6 +49,7 @@ public class MostVisitedItem implements OnCreateContextMenuListener,
private MostVisitedItemManager mManager;
private String mTitle;
private String mUrl;
+ private boolean mOfflineAvailable;
private int mIndex;
private int mTileType;
private View mView;
@@ -59,12 +60,15 @@ public class MostVisitedItem implements OnCreateContextMenuListener,
* @param manager The NewTabPageManager used to handle clicks and context menu events.
* @param title The title of the page.
* @param url The URL of the page.
+ * @param offlineAvailable Whether there is an offline copy of the URL available.
* @param index The index of this item in the list of most visited items.
*/
- public MostVisitedItem(MostVisitedItemManager manager, String title, String url, int index) {
+ public MostVisitedItem(MostVisitedItemManager manager, String title, String url,
+ boolean offlineAvailable, int index) {
mManager = manager;
mTitle = title;
mUrl = url;
+ mOfflineAvailable = offlineAvailable;
mIndex = index;
mTileType = MostVisitedTileType.NONE;
}
@@ -102,6 +106,13 @@ public class MostVisitedItem implements OnCreateContextMenuListener,
}
/**
+ * @return Whether this item is available offline.
+ */
+ public boolean isOfflineAvailable() {
+ return mOfflineAvailable;
+ }
+
+ /**
* @return The index of this MostVisitedItem in the list of MostVisitedItems.
*/
public int getIndex() {

Powered by Google App Engine
This is Rietveld 408576698