| 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/ntp/most_visited_sites_bridge.h" | 5 #include "chrome/browser/android/ntp/most_visited_sites_bridge.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 env, observer_.obj(), ToJavaArrayOfStrings(env, urls).obj(), | 105 env, observer_.obj(), ToJavaArrayOfStrings(env, urls).obj(), |
| 106 ToJavaArrayOfStrings(env, favicon_urls).obj(), | 106 ToJavaArrayOfStrings(env, favicon_urls).obj(), |
| 107 ToJavaArrayOfStrings(env, large_icon_urls).obj()); | 107 ToJavaArrayOfStrings(env, large_icon_urls).obj()); |
| 108 } | 108 } |
| 109 | 109 |
| 110 MostVisitedSitesBridge::MostVisitedSitesBridge(Profile* profile) | 110 MostVisitedSitesBridge::MostVisitedSitesBridge(Profile* profile) |
| 111 : most_visited_(profile->GetPrefs(), | 111 : most_visited_(profile->GetPrefs(), |
| 112 TemplateURLServiceFactory::GetForProfile(profile), | 112 TemplateURLServiceFactory::GetForProfile(profile), |
| 113 g_browser_process->variations_service(), | 113 g_browser_process->variations_service(), |
| 114 profile->GetRequestContext(), | 114 profile->GetRequestContext(), |
| 115 ChromePopularSites::GetDirectory(), |
| 115 TopSitesFactory::GetForProfile(profile), | 116 TopSitesFactory::GetForProfile(profile), |
| 116 SuggestionsServiceFactory::GetForProfile(profile), | 117 SuggestionsServiceFactory::GetForProfile(profile), |
| 117 profile->IsChild(), | 118 profile->IsChild(), |
| 118 profile) { | 119 profile) { |
| 119 // Register the thumbnails debugging page. | 120 // Register the thumbnails debugging page. |
| 120 // TODO(sfiera): find thumbnails a home. They don't belong here. | 121 // TODO(sfiera): find thumbnails a home. They don't belong here. |
| 121 content::URLDataSource::Add(profile, new ThumbnailListSource(profile)); | 122 content::URLDataSource::Add(profile, new ThumbnailListSource(profile)); |
| 122 } | 123 } |
| 123 | 124 |
| 124 MostVisitedSitesBridge::~MostVisitedSitesBridge() {} | 125 MostVisitedSitesBridge::~MostVisitedSitesBridge() {} |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 182 } |
| 182 | 183 |
| 183 static jlong Init(JNIEnv* env, | 184 static jlong Init(JNIEnv* env, |
| 184 const JavaParamRef<jobject>& obj, | 185 const JavaParamRef<jobject>& obj, |
| 185 const JavaParamRef<jobject>& jprofile) { | 186 const JavaParamRef<jobject>& jprofile) { |
| 186 MostVisitedSitesBridge* most_visited_sites = | 187 MostVisitedSitesBridge* most_visited_sites = |
| 187 new MostVisitedSitesBridge( | 188 new MostVisitedSitesBridge( |
| 188 ProfileAndroid::FromProfileAndroid(jprofile)); | 189 ProfileAndroid::FromProfileAndroid(jprofile)); |
| 189 return reinterpret_cast<intptr_t>(most_visited_sites); | 190 return reinterpret_cast<intptr_t>(most_visited_sites); |
| 190 } | 191 } |
| OLD | NEW |