OLD | NEW |
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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 case SUGGESTIONS_SERVICE: { | 298 case SUGGESTIONS_SERVICE: { |
299 SuggestionsService* suggestions_service = | 299 SuggestionsService* suggestions_service = |
300 SuggestionsServiceFactory::GetForProfile(profile_); | 300 SuggestionsServiceFactory::GetForProfile(profile_); |
301 DCHECK(suggestions_service); | 301 DCHECK(suggestions_service); |
302 suggestions_service->BlacklistURL( | 302 suggestions_service->BlacklistURL( |
303 GURL(url), | 303 GURL(url), |
304 base::Bind( | 304 base::Bind( |
305 &MostVisitedSites::OnSuggestionsProfileAvailable, | 305 &MostVisitedSites::OnSuggestionsProfileAvailable, |
306 weak_ptr_factory_.GetWeakPtr(), | 306 weak_ptr_factory_.GetWeakPtr(), |
307 base::Owned(new ScopedJavaGlobalRef<jobject>(observer_)))); | 307 base::Owned(new ScopedJavaGlobalRef<jobject>(observer_))), |
| 308 base::Closure()); |
308 break; | 309 break; |
309 } | 310 } |
310 } | 311 } |
311 } | 312 } |
312 | 313 |
313 void MostVisitedSites::RecordOpenedMostVisitedItem(JNIEnv* env, | 314 void MostVisitedSites::RecordOpenedMostVisitedItem(JNIEnv* env, |
314 jobject obj, | 315 jobject obj, |
315 jint index) { | 316 jint index) { |
316 switch (mv_source_) { | 317 switch (mv_source_) { |
317 case TOP_SITES: { | 318 case TOP_SITES: { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 num_empty_thumbs_ = 0; | 527 num_empty_thumbs_ = 0; |
527 UMA_HISTOGRAM_SPARSE_SLOWLY(kNumServerTilesHistogramName, num_server_thumbs_); | 528 UMA_HISTOGRAM_SPARSE_SLOWLY(kNumServerTilesHistogramName, num_server_thumbs_); |
528 num_server_thumbs_ = 0; | 529 num_server_thumbs_ = 0; |
529 } | 530 } |
530 | 531 |
531 static jlong Init(JNIEnv* env, jobject obj, jobject jprofile) { | 532 static jlong Init(JNIEnv* env, jobject obj, jobject jprofile) { |
532 MostVisitedSites* most_visited_sites = | 533 MostVisitedSites* most_visited_sites = |
533 new MostVisitedSites(ProfileAndroid::FromProfileAndroid(jprofile)); | 534 new MostVisitedSites(ProfileAndroid::FromProfileAndroid(jprofile)); |
534 return reinterpret_cast<intptr_t>(most_visited_sites); | 535 return reinterpret_cast<intptr_t>(most_visited_sites); |
535 } | 536 } |
OLD | NEW |