Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java b/chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java |
| index d1a141071e9e50d106d12c223a1ae02aa57a6f8d..ffec100e83b2d1189689d31e4f316c4e3baa87af 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java |
| @@ -13,7 +13,7 @@ import org.chromium.base.annotations.CalledByNative; |
| */ |
| public class MostVisitedSites { |
| - private long mNativeMostVisitedSites; |
| + private long mNativeMostVisitedSitesJavaBridge; |
|
Marc Treib
2016/04/19 08:14:47
nit: I'd call this just mNativeMostVisitedSitesBri
sfiera
2016/04/19 12:15:13
It has to match the type name. Since we're renamin
Marc Treib
2016/04/19 13:20:54
Today I learned!
|
| /** |
| * Interface for receiving the list of most visited urls. |
| @@ -57,7 +57,8 @@ public class MostVisitedSites { |
| * server-provided. |
| */ |
| @CalledByNative("ThumbnailCallback") |
| - public void onMostVisitedURLsThumbnailAvailable(Bitmap thumbnail, boolean isLocalThumbnail); |
| + public void onMostVisitedURLsThumbnailAvailable( |
| + Bitmap thumbnail, boolean isLocalThumbnail); |
|
Marc Treib
2016/04/19 08:14:47
Why this change? (In Java, lines are allowed to ha
sfiera
2016/04/19 12:15:13
I'd broken all the lines that were 100+, but this
Marc Treib
2016/04/19 13:20:54
git cl presubmit --upload (IIRC. Without the "--u
|
| } |
| /** |
| @@ -66,16 +67,16 @@ public class MostVisitedSites { |
| * @param profile The profile for which to fetch most visited sites. |
| */ |
| public MostVisitedSites(Profile profile) { |
| - mNativeMostVisitedSites = nativeInit(profile); |
| + mNativeMostVisitedSitesJavaBridge = nativeInit(profile); |
| } |
| /** |
| * Cleans up the C++ side of this class. This instance must not be used after calling destroy(). |
| */ |
| public void destroy() { |
| - assert mNativeMostVisitedSites != 0; |
| - nativeDestroy(mNativeMostVisitedSites); |
| - mNativeMostVisitedSites = 0; |
| + assert mNativeMostVisitedSitesJavaBridge != 0; |
| + nativeDestroy(mNativeMostVisitedSitesJavaBridge); |
| + mNativeMostVisitedSitesJavaBridge = 0; |
| } |
| /** |
| @@ -93,7 +94,7 @@ public class MostVisitedSites { |
| public void onMostVisitedURLsAvailable( |
| String[] titles, String[] urls, String[] whitelistIconPaths) { |
| // Don't notify observer if we've already been destroyed. |
| - if (mNativeMostVisitedSites != 0) { |
| + if (mNativeMostVisitedSitesJavaBridge != 0) { |
| observer.onMostVisitedURLsAvailable(titles, urls, whitelistIconPaths); |
| } |
| } |
| @@ -101,12 +102,13 @@ public class MostVisitedSites { |
| public void onPopularURLsAvailable( |
| String[] urls, String[] faviconUrls, String[] largeIconUrls) { |
| // Don't notify observer if we've already been destroyed. |
| - if (mNativeMostVisitedSites != 0) { |
| + if (mNativeMostVisitedSitesJavaBridge != 0) { |
| observer.onPopularURLsAvailable(urls, faviconUrls, largeIconUrls); |
| } |
| } |
| }; |
| - nativeSetMostVisitedURLsObserver(mNativeMostVisitedSites, wrappedObserver, numSites); |
| + nativeSetMostVisitedURLsObserver( |
| + mNativeMostVisitedSitesJavaBridge, wrappedObserver, numSites); |
| } |
| /** |
| @@ -121,26 +123,26 @@ public class MostVisitedSites { |
| public void onMostVisitedURLsThumbnailAvailable(Bitmap thumbnail, |
| boolean isLocalThumbnail) { |
| // Don't notify callback if we've already been destroyed. |
| - if (mNativeMostVisitedSites != 0) { |
| + if (mNativeMostVisitedSitesJavaBridge != 0) { |
| callback.onMostVisitedURLsThumbnailAvailable(thumbnail, isLocalThumbnail); |
| } |
| } |
| }; |
| - nativeGetURLThumbnail(mNativeMostVisitedSites, url, wrappedCallback); |
| + nativeGetURLThumbnail(mNativeMostVisitedSitesJavaBridge, url, wrappedCallback); |
| } |
| /** |
| * Blacklists a URL from the most visited URLs list. |
| */ |
| public void addBlacklistedUrl(String url) { |
| - nativeAddOrRemoveBlacklistedUrl(mNativeMostVisitedSites, url, true); |
| + nativeAddOrRemoveBlacklistedUrl(mNativeMostVisitedSitesJavaBridge, url, true); |
| } |
| /** |
| * Removes a URL from the most visited URLs blacklist. |
| */ |
| public void removeBlacklistedUrl(String url) { |
| - nativeAddOrRemoveBlacklistedUrl(mNativeMostVisitedSites, url, false); |
| + nativeAddOrRemoveBlacklistedUrl(mNativeMostVisitedSitesJavaBridge, url, false); |
| } |
| /** |
| @@ -149,7 +151,7 @@ public class MostVisitedSites { |
| * tile that's currently showing. |
| */ |
| public void recordTileTypeMetrics(int[] tileTypes) { |
| - nativeRecordTileTypeMetrics(mNativeMostVisitedSites, tileTypes); |
| + nativeRecordTileTypeMetrics(mNativeMostVisitedSitesJavaBridge, tileTypes); |
| } |
| /** |
| @@ -158,19 +160,21 @@ public class MostVisitedSites { |
| * @param tileType The visual type of the item. Valid values are listed in MostVisitedTileType. |
| */ |
| public void recordOpenedMostVisitedItem(int index, int tileType) { |
| - nativeRecordOpenedMostVisitedItem(mNativeMostVisitedSites, index, tileType); |
| + nativeRecordOpenedMostVisitedItem(mNativeMostVisitedSitesJavaBridge, index, tileType); |
| } |
| private native long nativeInit(Profile profile); |
| - private native void nativeDestroy(long nativeMostVisitedSites); |
| - private native void nativeSetMostVisitedURLsObserver(long nativeMostVisitedSites, |
| + private native void nativeDestroy(long nativeMostVisitedSitesJavaBridge); |
| + private native void nativeSetMostVisitedURLsObserver(long nativeMostVisitedSitesJavaBridge, |
| MostVisitedURLsObserver observer, int numSites); |
| - private native void nativeGetURLThumbnail(long nativeMostVisitedSites, String url, |
| + private native void nativeGetURLThumbnail(long nativeMostVisitedSitesJavaBridge, String url, |
| ThumbnailCallback callback); |
| - private native void nativeAddOrRemoveBlacklistedUrl(long nativeMostVisitedSites, String url, |
| + private native void nativeAddOrRemoveBlacklistedUrl( |
| + long nativeMostVisitedSitesJavaBridge, String url, |
| boolean addUrl); |
| - private native void nativeRecordTileTypeMetrics(long nativeMostVisitedSites, int[] tileTypes); |
| - private native void nativeRecordOpenedMostVisitedItem(long nativeMostVisitedSites, int index, |
| - int tileType); |
| + private native void nativeRecordTileTypeMetrics( |
| + long nativeMostVisitedSitesJavaBridge, int[] tileTypes); |
| + private native void nativeRecordOpenedMostVisitedItem( |
| + long nativeMostVisitedSitesJavaBridge, int index, int tileType); |
| } |