| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 227 |
| 228 ntp_tiles::metrics::RecordImpressionTileTypes(tile_types, sources); | 228 ntp_tiles::metrics::RecordImpressionTileTypes(tile_types, sources); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void MostVisitedSitesBridge::RecordOpenedMostVisitedItem( | 231 void MostVisitedSitesBridge::RecordOpenedMostVisitedItem( |
| 232 JNIEnv* env, | 232 JNIEnv* env, |
| 233 const JavaParamRef<jobject>& obj, | 233 const JavaParamRef<jobject>& obj, |
| 234 jint index, | 234 jint index, |
| 235 jint tile_type, | 235 jint tile_type, |
| 236 jint source) { | 236 jint source) { |
| 237 ntp_tiles::metrics::RecordClick(index, | 237 ntp_tiles::metrics::RecordTileClickWithTileType( |
| 238 static_cast<MostVisitedTileType>(tile_type), | 238 index, static_cast<NTPTileSource>(source), |
| 239 static_cast<NTPTileSource>(source)); | 239 static_cast<MostVisitedTileType>(tile_type)); |
| 240 } | 240 } |
| 241 | 241 |
| 242 // static | 242 // static |
| 243 bool MostVisitedSitesBridge::Register(JNIEnv* env) { | 243 bool MostVisitedSitesBridge::Register(JNIEnv* env) { |
| 244 return RegisterNativesImpl(env); | 244 return RegisterNativesImpl(env); |
| 245 } | 245 } |
| 246 | 246 |
| 247 static jlong Init(JNIEnv* env, | 247 static jlong Init(JNIEnv* env, |
| 248 const JavaParamRef<jobject>& obj, | 248 const JavaParamRef<jobject>& obj, |
| 249 const JavaParamRef<jobject>& jprofile) { | 249 const JavaParamRef<jobject>& jprofile) { |
| 250 MostVisitedSitesBridge* most_visited_sites = | 250 MostVisitedSitesBridge* most_visited_sites = |
| 251 new MostVisitedSitesBridge( | 251 new MostVisitedSitesBridge( |
| 252 ProfileAndroid::FromProfileAndroid(jprofile)); | 252 ProfileAndroid::FromProfileAndroid(jprofile)); |
| 253 return reinterpret_cast<intptr_t>(most_visited_sites); | 253 return reinterpret_cast<intptr_t>(most_visited_sites); |
| 254 } | 254 } |
| OLD | NEW |