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

Side by Side Diff: chrome/browser/android/most_visited_sites.cc

Issue 53283004: Adding support for forced URLs to TopSites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed GetAllMostVisited. Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/autocomplete/zero_suggest_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/android/most_visited_sites.h" 5 #include "chrome/browser/android/most_visited_sites.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 return; 152 return;
153 153
154 // TopSites updates itself after a delay. To ensure up-to-date results, force 154 // TopSites updates itself after a delay. To ensure up-to-date results, force
155 // an update now. 155 // an update now.
156 top_sites->SyncWithHistory(); 156 top_sites->SyncWithHistory();
157 157
158 scoped_refptr<NativeCallback> native_callback = 158 scoped_refptr<NativeCallback> native_callback =
159 new NativeCallback(j_callback_obj, static_cast<int>(num_results)); 159 new NativeCallback(j_callback_obj, static_cast<int>(num_results));
160 top_sites->GetMostVisitedURLs( 160 top_sites->GetMostVisitedURLs(
161 base::Bind(&NativeCallback::OnMostVisitedURLsAvailable, 161 base::Bind(&NativeCallback::OnMostVisitedURLsAvailable,
162 native_callback)); 162 native_callback), false);
163 } 163 }
164 164
165 // May be called from any thread 165 // May be called from any thread
166 void GetURLThumbnail( 166 void GetURLThumbnail(
167 JNIEnv* env, 167 JNIEnv* env,
168 jclass clazz, 168 jclass clazz,
169 jobject j_profile, 169 jobject j_profile,
170 jstring url, 170 jstring url,
171 jobject j_callback_obj) { 171 jobject j_callback_obj) {
172 Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); 172 Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile);
(...skipping 22 matching lines...) Expand all
195 if (!profile) 195 if (!profile)
196 return; 196 return;
197 197
198 TopSites* top_sites = profile->GetTopSites(); 198 TopSites* top_sites = profile->GetTopSites();
199 if (!top_sites) 199 if (!top_sites)
200 return; 200 return;
201 201
202 std::string url_string = ConvertJavaStringToUTF8(env, j_url); 202 std::string url_string = ConvertJavaStringToUTF8(env, j_url);
203 top_sites->AddBlacklistedURL(GURL(url_string)); 203 top_sites->AddBlacklistedURL(GURL(url_string));
204 } 204 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/zero_suggest_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698