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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java

Issue 1772363002: Start using the whitelist icon on the NTP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.profiles; 5 package org.chromium.chrome.browser.profiles;
6 6
7 import android.graphics.Bitmap; 7 import android.graphics.Bitmap;
8 8
9 import org.chromium.base.annotations.CalledByNative; 9 import org.chromium.base.annotations.CalledByNative;
10 10
(...skipping 11 matching lines...) Expand all
22 /** 22 /**
23 * This is called when the list of most visited URLs is initially availa ble or updated. 23 * This is called when the list of most visited URLs is initially availa ble or updated.
24 * Parameters guaranteed to be non-null. 24 * Parameters guaranteed to be non-null.
25 * 25 *
26 * @param titles Array of most visited url page titles. 26 * @param titles Array of most visited url page titles.
27 * @param urls Array of most visited URLs, including popular URLs if 27 * @param urls Array of most visited URLs, including popular URLs if
28 * available and necessary (i.e. there aren't enough most 28 * available and necessary (i.e. there aren't enough most
29 * visited URLs). 29 * visited URLs).
30 */ 30 */
31 @CalledByNative("MostVisitedURLsObserver") 31 @CalledByNative("MostVisitedURLsObserver")
32 public void onMostVisitedURLsAvailable(String[] titles, String[] urls); 32 public void onMostVisitedURLsAvailable(
33 String[] titles, String[] urls, String[] localIconPaths);
33 34
34 /** 35 /**
35 * This is called when the list of popular URLs is initially available o r updated. 36 * This is called when the list of popular URLs is initially available o r updated.
36 * Parameters guaranteed to be non-null. 37 * Parameters guaranteed to be non-null.
37 * 38 *
38 * @param urls Array of popular URLs. 39 * @param urls Array of popular URLs.
39 * @param faviconUrls Array of URLs for the corresponding favicons (if k nown). 40 * @param faviconUrls Array of URLs for the corresponding favicons (if k nown).
40 */ 41 */
41 @CalledByNative("MostVisitedURLsObserver") 42 @CalledByNative("MostVisitedURLsObserver")
42 public void onPopularURLsAvailable( 43 public void onPopularURLsAvailable(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 * after any changes to the list. Note: the observer may be notified synchro nously or 83 * after any changes to the list. Note: the observer may be notified synchro nously or
83 * asynchronously. 84 * asynchronously.
84 * @param observer The MostVisitedURLsObserver to be called once when the mo st visited sites 85 * @param observer The MostVisitedURLsObserver to be called once when the mo st visited sites
85 * are initially available and again whenever the list of mo st visited sites 86 * are initially available and again whenever the list of mo st visited sites
86 * changes. 87 * changes.
87 * @param numSites The maximum number of most visited sites to return. 88 * @param numSites The maximum number of most visited sites to return.
88 */ 89 */
89 public void setMostVisitedURLsObserver(final MostVisitedURLsObserver observe r, int numSites) { 90 public void setMostVisitedURLsObserver(final MostVisitedURLsObserver observe r, int numSites) {
90 MostVisitedURLsObserver wrappedObserver = new MostVisitedURLsObserver() { 91 MostVisitedURLsObserver wrappedObserver = new MostVisitedURLsObserver() {
91 @Override 92 @Override
92 public void onMostVisitedURLsAvailable(String[] titles, String[] url s) { 93 public void onMostVisitedURLsAvailable(
94 String[] titles, String[] urls, String[] localIconPaths) {
93 // Don't notify observer if we've already been destroyed. 95 // Don't notify observer if we've already been destroyed.
94 if (mNativeMostVisitedSites != 0) { 96 if (mNativeMostVisitedSites != 0) {
95 observer.onMostVisitedURLsAvailable(titles, urls); 97 observer.onMostVisitedURLsAvailable(titles, urls, localIconP aths);
96 } 98 }
97 } 99 }
98 @Override 100 @Override
99 public void onPopularURLsAvailable( 101 public void onPopularURLsAvailable(
100 String[] urls, String[] faviconUrls, String[] largeIconUrls) { 102 String[] urls, String[] faviconUrls, String[] largeIconUrls) {
101 // Don't notify observer if we've already been destroyed. 103 // Don't notify observer if we've already been destroyed.
102 if (mNativeMostVisitedSites != 0) { 104 if (mNativeMostVisitedSites != 0) {
103 observer.onPopularURLsAvailable(urls, faviconUrls, largeIcon Urls); 105 observer.onPopularURLsAvailable(urls, faviconUrls, largeIcon Urls);
104 } 106 }
105 } 107 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 MostVisitedURLsObserver observer, int numSites); 167 MostVisitedURLsObserver observer, int numSites);
166 private native void nativeGetURLThumbnail(long nativeMostVisitedSites, Strin g url, 168 private native void nativeGetURLThumbnail(long nativeMostVisitedSites, Strin g url,
167 ThumbnailCallback callback); 169 ThumbnailCallback callback);
168 private native void nativeAddOrRemoveBlacklistedUrl(long nativeMostVisitedSi tes, String url, 170 private native void nativeAddOrRemoveBlacklistedUrl(long nativeMostVisitedSi tes, String url,
169 boolean addUrl); 171 boolean addUrl);
170 private native void nativeRecordTileTypeMetrics(long nativeMostVisitedSites, int[] tileTypes); 172 private native void nativeRecordTileTypeMetrics(long nativeMostVisitedSites, int[] tileTypes);
171 private native void nativeRecordOpenedMostVisitedItem(long nativeMostVisited Sites, int index, 173 private native void nativeRecordOpenedMostVisitedItem(long nativeMostVisited Sites, int index,
172 int tileType); 174 int tileType);
173 175
174 } 176 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698