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

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: review3 Created 5 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/android/popular_sites.h » ('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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/popular_sites.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698