OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 package org.chromium.chrome.browser.contextualsearch; | 5 package org.chromium.chrome.browser.contextualsearch; |
6 | 6 |
7 import org.chromium.base.annotations.CalledByNative; | 7 import org.chromium.base.annotations.CalledByNative; |
8 import org.chromium.chrome.browser.preferences.ChromePreferenceManager; | 8 import org.chromium.chrome.browser.preferences.ChromePreferenceManager; |
9 | 9 |
10 /** | 10 /** |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 if (wasActivatedByTap) { | 81 if (wasActivatedByTap) { |
82 nativeRecordImpression(mNativePointer, wasSearchContentViewSeen); | 82 nativeRecordImpression(mNativePointer, wasSearchContentViewSeen); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 @Override | 86 @Override |
87 protected void logRankerTapSuppression(ContextualSearchRankerLogger logger)
{ | 87 protected void logRankerTapSuppression(ContextualSearchRankerLogger logger)
{ |
88 if (nativeHasPreviousWeekData(mNativePointer)) { | 88 if (nativeHasPreviousWeekData(mNativePointer)) { |
89 int previousWeekImpressions = nativeGetPreviousWeekImpressions(mNati
vePointer); | 89 int previousWeekImpressions = nativeGetPreviousWeekImpressions(mNati
vePointer); |
90 int previousWeekCtr = (int) (100 * nativeGetPreviousWeekCtr(mNativeP
ointer)); | 90 int previousWeekCtr = (int) (100 * nativeGetPreviousWeekCtr(mNativeP
ointer)); |
91 logger.log(ContextualSearchRankerLogger.Feature.PREVIOUS_WEEK_IMPRES
SIONS_COUNT, | 91 logger.logFeature(ContextualSearchRankerLogger.Feature.PREVIOUS_WEEK
_IMPRESSIONS_COUNT, |
92 previousWeekImpressions); | 92 previousWeekImpressions); |
93 logger.log(ContextualSearchRankerLogger.Feature.PREVIOUS_WEEK_CTR_PE
RCENT, | 93 logger.logFeature(ContextualSearchRankerLogger.Feature.PREVIOUS_WEEK
_CTR_PERCENT, |
94 previousWeekCtr); | 94 previousWeekCtr); |
95 } | 95 } |
96 | 96 |
97 if (nativeHasPrevious28DayData(mNativePointer)) { | 97 if (nativeHasPrevious28DayData(mNativePointer)) { |
98 int previous28DayImpressions = nativeGetPrevious28DayImpressions(mNa
tivePointer); | 98 int previous28DayImpressions = nativeGetPrevious28DayImpressions(mNa
tivePointer); |
99 int previous28DayCtr = (int) (100 * nativeGetPrevious28DayCtr(mNativ
ePointer)); | 99 int previous28DayCtr = (int) (100 * nativeGetPrevious28DayCtr(mNativ
ePointer)); |
100 logger.log(ContextualSearchRankerLogger.Feature.PREVIOUS_28DAY_IMPRE
SSIONS_COUNT, | 100 logger.logFeature(ContextualSearchRankerLogger.Feature.PREVIOUS_28DA
Y_IMPRESSIONS_COUNT, |
101 previous28DayImpressions); | 101 previous28DayImpressions); |
102 logger.log(ContextualSearchRankerLogger.Feature.PREVIOUS_28DAY_CTR_P
ERCENT, | 102 logger.logFeature(ContextualSearchRankerLogger.Feature.PREVIOUS_28DA
Y_CTR_PERCENT, |
103 previous28DayCtr); | 103 previous28DayCtr); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 // =========================================================================
=================== | 107 // =========================================================================
=================== |
108 // Device integer storage. | 108 // Device integer storage. |
109 // =========================================================================
=================== | 109 // =========================================================================
=================== |
110 | 110 |
111 @CalledByNative | 111 @CalledByNative |
112 void writeInt(String key, int value) { | 112 void writeInt(String key, int value) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 private native void nativeRecordImpression(long nativeCtrSuppression, boolea
n wasSeen); | 156 private native void nativeRecordImpression(long nativeCtrSuppression, boolea
n wasSeen); |
157 private native int nativeGetCurrentWeekNumber(long nativeCtrSuppression); | 157 private native int nativeGetCurrentWeekNumber(long nativeCtrSuppression); |
158 private native boolean nativeHasPreviousWeekData(long nativeCtrSuppression); | 158 private native boolean nativeHasPreviousWeekData(long nativeCtrSuppression); |
159 private native int nativeGetPreviousWeekImpressions(long nativeCtrSuppressio
n); | 159 private native int nativeGetPreviousWeekImpressions(long nativeCtrSuppressio
n); |
160 private native float nativeGetPreviousWeekCtr(long nativeCtrSuppression); | 160 private native float nativeGetPreviousWeekCtr(long nativeCtrSuppression); |
161 private native boolean nativeHasPrevious28DayData(long nativeCtrSuppression)
; | 161 private native boolean nativeHasPrevious28DayData(long nativeCtrSuppression)
; |
162 private native int nativeGetPrevious28DayImpressions(long nativeCtrSuppressi
on); | 162 private native int nativeGetPrevious28DayImpressions(long nativeCtrSuppressi
on); |
163 private native float nativeGetPrevious28DayCtr(long nativeCtrSuppression); | 163 private native float nativeGetPrevious28DayCtr(long nativeCtrSuppression); |
164 } | 164 } |
OLD | NEW |