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

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

Issue 1957313003: Remove PopularSites' dependencies on //chrome/.... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/ntp/most_visited_sites_bridge.cc
diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
index b606586073708ef5dba7298e42882f8918b9e1ab..4856cf6dc53c3815c6c35e42bd6f68edafa07e67 100644
--- a/chrome/browser/android/ntp/most_visited_sites_bridge.cc
+++ b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
@@ -12,6 +12,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/bind.h"
#include "base/callback.h"
+#include "base/path_service.h"
#include "chrome/browser/android/ntp/popular_sites.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/history/top_sites_factory.h"
@@ -20,6 +21,7 @@
#include "chrome/browser/search/suggestions/suggestions_service_factory.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/thumbnails/thumbnail_list_source.h"
+#include "chrome/common/chrome_paths.h"
#include "components/history/core/browser/top_sites.h"
#include "content/public/browser/url_data_source.h"
#include "jni/MostVisitedSites_jni.h"
@@ -47,6 +49,12 @@ void CallJavaWithBitmap(
env, j_callback->obj(), j_bitmap.obj(), is_local_thumbnail);
}
+base::FilePath GetPopularSitesDirectory() {
+ base::FilePath dir;
+ PathService::Get(chrome::DIR_USER_DATA, &dir);
+ return dir; // empty if PathService::Get() failed.
+}
+
} // namespace
class MostVisitedSitesBridge::Observer
@@ -112,6 +120,7 @@ MostVisitedSitesBridge::MostVisitedSitesBridge(Profile* profile)
TemplateURLServiceFactory::GetForProfile(profile),
g_browser_process->variations_service(),
profile->GetRequestContext(),
+ GetPopularSitesDirectory(),
TopSitesFactory::GetForProfile(profile),
SuggestionsServiceFactory::GetForProfile(profile),
profile->IsChild(),

Powered by Google App Engine
This is Rietveld 408576698