| 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 "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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 observer_.Reset(env, j_observer); | 245 observer_.Reset(env, j_observer); |
| 246 num_sites_ = num_sites; | 246 num_sites_ = num_sites; |
| 247 | 247 |
| 248 if (ShouldShowPopularSites() && | 248 if (ShouldShowPopularSites() && |
| 249 NeedPopularSites(profile_->GetPrefs(), num_sites_)) { | 249 NeedPopularSites(profile_->GetPrefs(), num_sites_)) { |
| 250 popular_sites_.reset(new PopularSites( | 250 popular_sites_.reset(new PopularSites( |
| 251 profile_, | 251 profile_, |
| 252 GetPopularSitesCountry(), | 252 GetPopularSitesCountry(), |
| 253 GetPopularSitesVersion(), | 253 GetPopularSitesVersion(), |
| 254 GetPopularSitesFilename(), | 254 GetPopularSitesFilename(), |
| 255 false, |
| 255 base::Bind(&MostVisitedSites::OnPopularSitesAvailable, | 256 base::Bind(&MostVisitedSites::OnPopularSitesAvailable, |
| 256 base::Unretained(this)))); | 257 base::Unretained(this)))); |
| 257 } else { | 258 } else { |
| 258 received_popular_sites_ = true; | 259 received_popular_sites_ = true; |
| 259 } | 260 } |
| 260 | 261 |
| 261 QueryMostVisitedURLs(); | 262 QueryMostVisitedURLs(); |
| 262 | 263 |
| 263 scoped_refptr<history::TopSites> top_sites = | 264 scoped_refptr<history::TopSites> top_sites = |
| 264 TopSitesFactory::GetForProfile(profile_); | 265 TopSitesFactory::GetForProfile(profile_); |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 } | 740 } |
| 740 } | 741 } |
| 741 | 742 |
| 742 static jlong Init(JNIEnv* env, | 743 static jlong Init(JNIEnv* env, |
| 743 const JavaParamRef<jobject>& obj, | 744 const JavaParamRef<jobject>& obj, |
| 744 const JavaParamRef<jobject>& jprofile) { | 745 const JavaParamRef<jobject>& jprofile) { |
| 745 MostVisitedSites* most_visited_sites = | 746 MostVisitedSites* most_visited_sites = |
| 746 new MostVisitedSites(ProfileAndroid::FromProfileAndroid(jprofile)); | 747 new MostVisitedSites(ProfileAndroid::FromProfileAndroid(jprofile)); |
| 747 return reinterpret_cast<intptr_t>(most_visited_sites); | 748 return reinterpret_cast<intptr_t>(most_visited_sites); |
| 748 } | 749 } |
| OLD | NEW |