| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedLayout.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedLayout.java
|
| index 9ec2ef691040d6a6d8d122ecb69bbc55f36c01c1..47c99aa95f4363766c8b92d5ba483e642927c156 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedLayout.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/MostVisitedLayout.java
|
| @@ -6,6 +6,8 @@ package org.chromium.chrome.browser.ntp;
|
|
|
| import android.content.Context;
|
| import android.content.res.Resources;
|
| +import android.graphics.drawable.Drawable;
|
| +import android.text.TextUtils;
|
| import android.util.AttributeSet;
|
| import android.view.View;
|
| import android.widget.FrameLayout;
|
| @@ -66,6 +68,22 @@ public class MostVisitedLayout extends FrameLayout {
|
| forceLayout();
|
| }
|
|
|
| + /**
|
| + * Sets a new icon on the child view with a matching URL.
|
| + * @param url The site URL of the child tile view.
|
| + * @param icon The icon to set.
|
| + */
|
| + public void updateIconView(String url, Drawable icon) {
|
| + int childCount = getChildCount();
|
| + for (int i = 0; i < childCount; i++) {
|
| + MostVisitedItemView tileView = (MostVisitedItemView) getChildAt(i);
|
| + if (TextUtils.equals(url, tileView.getUrl())) {
|
| + tileView.setIcon(icon);
|
| + break;
|
| + }
|
| + }
|
| + }
|
| +
|
| @Override
|
| protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
| int totalWidth = resolveSize(mMaxWidth, widthMeasureSpec);
|
|
|