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

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

Issue 1340493002: Add initial version of chrome://popular-sites-internals page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@finch_country_version
Patch Set: Created 5 years, 3 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 #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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 observer_.Reset(env, j_observer); 243 observer_.Reset(env, j_observer);
244 num_sites_ = num_sites; 244 num_sites_ = num_sites;
245 245
246 if (ShouldShowPopularSites() && 246 if (ShouldShowPopularSites() &&
247 NeedPopularSites(profile_->GetPrefs(), num_sites_)) { 247 NeedPopularSites(profile_->GetPrefs(), num_sites_)) {
248 popular_sites_.reset(new PopularSites( 248 popular_sites_.reset(new PopularSites(
249 profile_, 249 profile_,
250 GetPopularSitesCountry(), 250 GetPopularSitesCountry(),
251 GetPopularSitesVersion(), 251 GetPopularSitesVersion(),
252 GetPopularSitesFilename(), 252 GetPopularSitesFilename(),
253 false,
253 base::Bind(&MostVisitedSites::OnPopularSitesAvailable, 254 base::Bind(&MostVisitedSites::OnPopularSitesAvailable,
254 base::Unretained(this)))); 255 base::Unretained(this))));
255 } else { 256 } else {
256 received_popular_sites_ = true; 257 received_popular_sites_ = true;
257 } 258 }
258 259
259 QueryMostVisitedURLs(); 260 QueryMostVisitedURLs();
260 261
261 scoped_refptr<history::TopSites> top_sites = 262 scoped_refptr<history::TopSites> top_sites =
262 TopSitesFactory::GetForProfile(profile_); 263 TopSitesFactory::GetForProfile(profile_);
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 } 738 }
738 } 739 }
739 740
740 static jlong Init(JNIEnv* env, 741 static jlong Init(JNIEnv* env,
741 const JavaParamRef<jobject>& obj, 742 const JavaParamRef<jobject>& obj,
742 const JavaParamRef<jobject>& jprofile) { 743 const JavaParamRef<jobject>& jprofile) {
743 MostVisitedSites* most_visited_sites = 744 MostVisitedSites* most_visited_sites =
744 new MostVisitedSites(ProfileAndroid::FromProfileAndroid(jprofile)); 745 new MostVisitedSites(ProfileAndroid::FromProfileAndroid(jprofile));
745 return reinterpret_cast<intptr_t>(most_visited_sites); 746 return reinterpret_cast<intptr_t>(most_visited_sites);
746 } 747 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/popular_sites.h » ('j') | chrome/browser/android/popular_sites.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698