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

Unified Diff: chrome/browser/android/ntp/popular_sites.cc

Issue 2457033003: Add chrome://popular-sites-internals/ to iOS. (Closed)
Patch Set: Break out ...Client. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/ntp/popular_sites.h ('k') | chrome/browser/browser_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/ntp/popular_sites.cc
diff --git a/chrome/browser/android/ntp/popular_sites.cc b/chrome/browser/android/ntp/popular_sites.cc
index 7fea2a8b72e6b123cb5f576586847c548dae6694..3413ce436c3532d4787b60ab4ffdefca83daed26 100644
--- a/chrome/browser/android/ntp/popular_sites.cc
+++ b/chrome/browser/android/ntp/popular_sites.cc
@@ -4,11 +4,24 @@
#include "chrome/browser/android/ntp/popular_sites.h"
+#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/path_service.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/common/chrome_paths.h"
+#include "components/ntp_tiles/popular_sites.h"
+#include "components/safe_json/safe_json_parser.h"
+#include "content/public/browser/browser_thread.h"
-base::FilePath ChromePopularSites::GetDirectory() {
- base::FilePath dir;
- PathService::Get(chrome::DIR_USER_DATA, &dir);
- return dir; // empty if PathService::Get() failed.
+std::unique_ptr<ntp_tiles::PopularSites> ChromePopularSites::NewForProfile(
+ Profile* profile) {
+ base::FilePath directory; // remains empty if PathService::Get() fails.
+ PathService::Get(chrome::DIR_USER_DATA, &directory);
+ return base::MakeUnique<ntp_tiles::PopularSites>(
+ content::BrowserThread::GetBlockingPool(), profile->GetPrefs(),
+ TemplateURLServiceFactory::GetForProfile(profile),
+ g_browser_process->variations_service(), profile->GetRequestContext(),
+ directory, base::Bind(safe_json::SafeJsonParser::Parse));
}
« no previous file with comments | « chrome/browser/android/ntp/popular_sites.h ('k') | chrome/browser/browser_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698