Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.suggestions; | 5 package org.chromium.chrome.browser.suggestions; |
| 6 | 6 |
| 7 import android.graphics.drawable.Drawable; | 7 import android.graphics.drawable.Drawable; |
| 8 import android.support.annotation.Nullable; | 8 import android.support.annotation.Nullable; |
| 9 | 9 |
| 10 import org.chromium.chrome.browser.ntp.MostVisitedTileType; | |
| 11 import org.chromium.chrome.browser.ntp.MostVisitedTileType.MostVisitedTileTypeEn um; | |
| 12 import org.chromium.chrome.browser.ntp.NTPTileSource.NTPTileSourceEnum; | 10 import org.chromium.chrome.browser.ntp.NTPTileSource.NTPTileSourceEnum; |
| 11 import org.chromium.chrome.browser.ntp.NTPTileType; | |
| 12 import org.chromium.chrome.browser.ntp.NTPTileType.NTPTileTypeEnum; | |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * Holds the details to populate a site suggestion tile. | 15 * Holds the details to populate a site suggestion tile. |
| 16 */ | 16 */ |
| 17 public class Tile implements OfflinableSuggestion { | 17 public class Tile implements OfflinableSuggestion { |
| 18 private final String mTitle; | 18 private final String mTitle; |
| 19 private final String mUrl; | 19 private final String mUrl; |
| 20 private final String mWhitelistIconPath; | 20 private final String mWhitelistIconPath; |
| 21 private final int mIndex; | 21 private final int mIndex; |
| 22 | 22 |
| 23 @NTPTileSourceEnum | 23 @NTPTileSourceEnum |
| 24 private final int mSource; | 24 private final int mSource; |
| 25 | 25 |
| 26 @MostVisitedTileTypeEnum | 26 @NTPTileTypeEnum |
| 27 private int mType = MostVisitedTileType.NONE; | 27 private int mType = NTPTileType.NONE; |
| 28 | 28 |
| 29 @Nullable | 29 @Nullable |
| 30 private Drawable mIcon; | 30 private Drawable mIcon; |
| 31 | 31 |
| 32 @Nullable | 32 @Nullable |
| 33 private Long mOfflinePageOfflineId; | 33 private Long mOfflinePageOfflineId; |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * @param title The tile title. | 36 * @param title The tile title. |
| 37 * @param url The site URL. | 37 * @param url The site URL. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 /** | 126 /** |
| 127 * @return The source of this tile. Used for metrics tracking. Valid values are listed in | 127 * @return The source of this tile. Used for metrics tracking. Valid values are listed in |
| 128 * {@code NTPTileSource}. | 128 * {@code NTPTileSource}. |
| 129 */ | 129 */ |
| 130 @NTPTileSourceEnum | 130 @NTPTileSourceEnum |
| 131 public int getSource() { | 131 public int getSource() { |
| 132 return mSource; | 132 return mSource; |
| 133 } | 133 } |
| 134 | 134 |
| 135 /** | 135 /** |
| 136 * @return The visual type of this tile. Valid values are listed in | 136 * @return The visual type of this tile. Valid values are listed in |
|
Michael van Ouwerkerk
2017/03/31 09:01:15
Can this fit on one line?
Marc Treib
2017/04/03 13:23:09
Yep, done.
| |
| 137 * {@link MostVisitedTileType}. | 137 * {@link NTPTileType}. |
| 138 */ | 138 */ |
| 139 @MostVisitedTileTypeEnum | 139 @NTPTileTypeEnum |
| 140 public int getType() { | 140 public int getType() { |
| 141 return mType; | 141 return mType; |
| 142 } | 142 } |
| 143 | 143 |
| 144 /** | 144 /** |
| 145 * Sets the visual type of this tile. Valid values are listed in | 145 * Sets the visual type of this tile. Valid values are listed in |
| 146 * {@link MostVisitedTileType}. | 146 * {@link NTPTileType}. |
| 147 */ | 147 */ |
| 148 public void setType(@MostVisitedTileTypeEnum int type) { | 148 public void setType(@NTPTileTypeEnum int type) { |
| 149 mType = type; | 149 mType = type; |
| 150 } | 150 } |
| 151 | 151 |
| 152 /** | 152 /** |
| 153 * @return The icon, may be null. | 153 * @return The icon, may be null. |
| 154 */ | 154 */ |
| 155 @Nullable | 155 @Nullable |
| 156 public Drawable getIcon() { | 156 public Drawable getIcon() { |
| 157 return mIcon; | 157 return mIcon; |
| 158 } | 158 } |
| 159 | 159 |
| 160 /** | 160 /** |
| 161 * Updates the icon drawable. | 161 * Updates the icon drawable. |
| 162 */ | 162 */ |
| 163 public void setIcon(@Nullable Drawable icon) { | 163 public void setIcon(@Nullable Drawable icon) { |
| 164 mIcon = icon; | 164 mIcon = icon; |
| 165 } | 165 } |
| 166 } | 166 } |
| OLD | NEW |