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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java

Issue 1309803005: Allow direct and indirect navigation values to be varied via field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Squash compile failure on windows Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.banners; 5 package org.chromium.chrome.browser.banners;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.text.TextUtils; 8 import android.text.TextUtils;
9 9
10 import org.chromium.base.ApplicationStatus; 10 import org.chromium.base.ApplicationStatus;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 /** Disables the HTTPS scheme requirement for testing. */ 152 /** Disables the HTTPS scheme requirement for testing. */
153 @VisibleForTesting 153 @VisibleForTesting
154 static void disableSecureSchemeCheckForTesting() { 154 static void disableSecureSchemeCheckForTesting() {
155 nativeDisableSecureSchemeCheckForTesting(); 155 nativeDisableSecureSchemeCheckForTesting();
156 } 156 }
157 157
158 /** Sets the weights of direct and indirect page navigations for testing. */ 158 /** Sets the weights of direct and indirect page navigations for testing. */
159 @VisibleForTesting 159 @VisibleForTesting
160 static void forceEngagementWeightsForTesting(double directEngagement, 160 static void setEngagementWeights(double directEngagement, double indirectEng agement) {
161 double indirectEngagement) { 161 nativeSetEngagementWeights(directEngagement, indirectEngagement);
162 nativeForceEngagementWeightsForTesting(directEngagement, indirectEngagem ent);
163 } 162 }
164 163
165 /** Returns whether a AppBannerDataFetcher is actively retrieving data. */ 164 /** Returns whether a AppBannerDataFetcher is actively retrieving data. */
166 @VisibleForTesting 165 @VisibleForTesting
167 public boolean isFetcherActiveForTesting() { 166 public boolean isFetcherActiveForTesting() {
168 return nativeIsFetcherActive(mNativePointer); 167 return nativeIsFetcherActive(mNativePointer);
169 } 168 }
170 169
171 private static native boolean nativeIsEnabled(); 170 private static native boolean nativeIsEnabled();
172 private native long nativeInit(int iconSize); 171 private native long nativeInit(int iconSize);
173 private native void nativeDestroy(long nativeAppBannerManagerAndroid); 172 private native void nativeDestroy(long nativeAppBannerManagerAndroid);
174 private native void nativeReplaceWebContents(long nativeAppBannerManagerAndr oid, 173 private native void nativeReplaceWebContents(long nativeAppBannerManagerAndr oid,
175 WebContents webContents); 174 WebContents webContents);
176 private native boolean nativeOnAppDetailsRetrieved(long nativeAppBannerManag erAndroid, 175 private native boolean nativeOnAppDetailsRetrieved(long nativeAppBannerManag erAndroid,
177 AppData data, String title, String packageName, String imageUrl); 176 AppData data, String title, String packageName, String imageUrl);
178 177
179 // Testing methods. 178 // Testing methods.
180 private static native void nativeSetTimeDeltaForTesting(int days); 179 private static native void nativeSetTimeDeltaForTesting(int days);
181 private static native void nativeDisableSecureSchemeCheckForTesting(); 180 private static native void nativeDisableSecureSchemeCheckForTesting();
182 private static native void nativeForceEngagementWeightsForTesting( 181 private static native void nativeSetEngagementWeights(double directEngagemen t,
183 double directEngagement, double indirectEngagement); 182 double indirectEngagement);
184 private native boolean nativeIsFetcherActive(long nativeAppBannerManagerAndr oid); 183 private native boolean nativeIsFetcherActive(long nativeAppBannerManagerAndr oid);
185 } 184 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698