Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/suggestions/Tile.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/Tile.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/Tile.java |
| index 48a9d3a5bdac0f8fd21fdbaff5ab959bf6411198..bb3c1c9318c2262d6cf49d2806b2d27ece9545cb 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/Tile.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/Tile.java |
| @@ -50,6 +50,29 @@ public Tile(String title, String url, String whitelistIconPath, boolean offlineA |
| } |
| /** |
| + * Import transient data from an old time, and report whether there is a significant difference |
|
Michael van Ouwerkerk
2017/02/22 12:11:59
nit: 'Imports transient data from another tile, an
dgn
2017/02/22 17:22:19
Done.
|
| + * between the two that would require a redraw. |
| + */ |
| + public boolean importData(Tile tile) { |
|
Michael van Ouwerkerk
2017/02/22 12:11:59
nit: mark the argument @Nullable
dgn
2017/02/22 17:22:19
Done.
|
| + if (tile == null) return true; |
| + |
| + assert tile.getUrl().equals(mUrl); // precondition for triggering the import. |
|
Michael van Ouwerkerk
2017/02/22 12:11:59
This requirement should be mentioned in the method
dgn
2017/02/22 17:22:18
Done.
|
| + |
| + mType = tile.getType(); |
| + mIcon = tile.getIcon(); |
| + |
| + if (!tile.getTitle().equals(mTitle)) return true; |
|
Michael van Ouwerkerk
2017/02/22 12:11:59
Use TextUtils.equals?
dgn
2017/02/22 17:22:18
url can't be null. Added check for that in buildTi
|
| + if (tile.isOfflineAvailable() != mOfflineAvailable) return true; |
| + if (tile.getIndex() != mIndex) return true; |
| + |
| + // Ignore the whitelist changes when we already have an icon, since we won't need to reload |
| + // it. We also omit requesting a redraw when |mSource| changes, as it only affects UMA. |
| + if (!tile.getWhitelistIconPath().equals(mWhitelistIconPath) && mIcon == null) return true; |
| + |
| + return false; |
| + } |
| + |
| + /** |
| * @return The site URL of this tile. |
| */ |
| public String getUrl() { |