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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java

Issue 2894913003: [TTS] Move Ranker logging to inference time. (Closed)
Patch Set: Rebase only. Created 3 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 android.text.TextUtils; 7 import android.text.TextUtils;
8 8
9 import org.chromium.base.CommandLine; 9 import org.chromium.base.CommandLine;
10 import org.chromium.base.SysUtils; 10 import org.chromium.base.SysUtils;
(...skipping 14 matching lines...) Expand all
25 static final String MANDATORY_PROMO_LIMIT = "mandatory_promo_limit"; 25 static final String MANDATORY_PROMO_LIMIT = "mandatory_promo_limit";
26 static final int MANDATORY_PROMO_DEFAULT_LIMIT = 10; 26 static final int MANDATORY_PROMO_DEFAULT_LIMIT = 10;
27 27
28 private static final String PEEK_PROMO_FORCED = "peek_promo_forced"; 28 private static final String PEEK_PROMO_FORCED = "peek_promo_forced";
29 @VisibleForTesting 29 @VisibleForTesting
30 static final String PEEK_PROMO_ENABLED = "peek_promo_enabled"; 30 static final String PEEK_PROMO_ENABLED = "peek_promo_enabled";
31 private static final String PEEK_PROMO_MAX_SHOW_COUNT = "peek_promo_max_show _count"; 31 private static final String PEEK_PROMO_MAX_SHOW_COUNT = "peek_promo_max_show _count";
32 private static final int PEEK_PROMO_DEFAULT_MAX_SHOW_COUNT = 10; 32 private static final int PEEK_PROMO_DEFAULT_MAX_SHOW_COUNT = 10;
33 33
34 private static final String DISABLE_SEARCH_TERM_RESOLUTION = "disable_search _term_resolution"; 34 private static final String DISABLE_SEARCH_TERM_RESOLUTION = "disable_search _term_resolution";
35 private static final String ENABLE_BLACKLIST = "enable_blacklist"; 35 private static final String WAIT_AFTER_TAP_DELAY_MS = "wait_after_tap_delay_ ms";
36 36
37 // Translation. All these members are private, except for usage by testing. 37 // Translation. All these members are private, except for usage by testing.
38 // Master switch, needed to disable all translate code for Contextual Search in case of an 38 // Master switch, needed to disable all translate code for Contextual Search in case of an
39 // emergency. 39 // emergency.
40 @VisibleForTesting 40 @VisibleForTesting
41 static final String DISABLE_TRANSLATION = "disable_translation"; 41 static final String DISABLE_TRANSLATION = "disable_translation";
42 // Enables usage of English as the target language even when it's the primar y UI language. 42 // Enables usage of English as the target language even when it's the primar y UI language.
43 @VisibleForTesting 43 @VisibleForTesting
44 static final String ENABLE_ENGLISH_TARGET_TRANSLATION = 44 static final String ENABLE_ENGLISH_TARGET_TRANSLATION =
45 "enable_english_target_translation"; 45 "enable_english_target_translation";
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 private static Boolean sIsBarOverlapCollectionEnabled; 79 private static Boolean sIsBarOverlapCollectionEnabled;
80 private static Boolean sIsBarOverlapSuppressionEnabled; 80 private static Boolean sIsBarOverlapSuppressionEnabled;
81 private static Integer sMinimumSelectionLength; 81 private static Integer sMinimumSelectionLength;
82 private static Boolean sIsOnlineDetectionDisabled; 82 private static Boolean sIsOnlineDetectionDisabled;
83 private static Boolean sIsAmpAsSeparateTabDisabled; 83 private static Boolean sIsAmpAsSeparateTabDisabled;
84 private static Boolean sContextualSearchSingleActionsEnabled; 84 private static Boolean sContextualSearchSingleActionsEnabled;
85 private static Boolean sIsSendHomeCountryDisabled; 85 private static Boolean sIsSendHomeCountryDisabled;
86 private static Boolean sIsPageContentNotificationDisabled; 86 private static Boolean sIsPageContentNotificationDisabled;
87 private static Boolean sContextualSearchUrlActionsEnabled; 87 private static Boolean sContextualSearchUrlActionsEnabled;
88 private static Boolean sIsRankerLoggingEnabled; 88 private static Boolean sIsRankerLoggingEnabled;
89 private static Integer sWaitAfterTapDelayMs;
89 90
90 /** 91 /**
91 * Don't instantiate. 92 * Don't instantiate.
92 */ 93 */
93 private ContextualSearchFieldTrial() {} 94 private ContextualSearchFieldTrial() {}
94 95
95 /** 96 /**
96 * Checks the current Variations parameters associated with the active group as well as the 97 * Checks the current Variations parameters associated with the active group as well as the
97 * Chrome preference to determine if the service is enabled. 98 * Chrome preference to determine if the service is enabled.
98 * @return Whether Contextual Search is enabled or not. 99 * @return Whether Contextual Search is enabled or not.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 * @return Whether the Peek Promo is enabled. 176 * @return Whether the Peek Promo is enabled.
176 */ 177 */
177 static boolean isPeekPromoEnabled() { 178 static boolean isPeekPromoEnabled() {
178 if (sIsPeekPromoEnabled == null) { 179 if (sIsPeekPromoEnabled == null) {
179 sIsPeekPromoEnabled = getBooleanParam(PEEK_PROMO_ENABLED); 180 sIsPeekPromoEnabled = getBooleanParam(PEEK_PROMO_ENABLED);
180 } 181 }
181 return sIsPeekPromoEnabled.booleanValue(); 182 return sIsPeekPromoEnabled.booleanValue();
182 } 183 }
183 184
184 /** 185 /**
185 * @return Whether the blacklist is enabled.
186 */
187 static boolean isBlacklistEnabled() {
188 return getBooleanParam(ENABLE_BLACKLIST);
189 }
190
191 /**
192 * @return The maximum number of times the Peek Promo should be displayed. 186 * @return The maximum number of times the Peek Promo should be displayed.
193 */ 187 */
194 static int getPeekPromoMaxShowCount() { 188 static int getPeekPromoMaxShowCount() {
195 if (sPeekPromoMaxCount == null) { 189 if (sPeekPromoMaxCount == null) {
196 sPeekPromoMaxCount = getIntParamValueOrDefault( 190 sPeekPromoMaxCount = getIntParamValueOrDefault(
197 PEEK_PROMO_MAX_SHOW_COUNT, 191 PEEK_PROMO_MAX_SHOW_COUNT,
198 PEEK_PROMO_DEFAULT_MAX_SHOW_COUNT); 192 PEEK_PROMO_DEFAULT_MAX_SHOW_COUNT);
199 } 193 }
200 return sPeekPromoMaxCount.intValue(); 194 return sPeekPromoMaxCount.intValue();
201 } 195 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 * @return Whether or not logging to Ranker is enabled. 303 * @return Whether or not logging to Ranker is enabled.
310 */ 304 */
311 static boolean isRankerLoggingEnabled() { 305 static boolean isRankerLoggingEnabled() {
312 if (sIsRankerLoggingEnabled == null) { 306 if (sIsRankerLoggingEnabled == null) {
313 sIsRankerLoggingEnabled = getBooleanParam(ENABLE_RANKER_LOGGING); 307 sIsRankerLoggingEnabled = getBooleanParam(ENABLE_RANKER_LOGGING);
314 } 308 }
315 309
316 return sIsRankerLoggingEnabled; 310 return sIsRankerLoggingEnabled;
317 } 311 }
318 312
319 // --------------- 313 /**
320 // Features. 314 * Gets an amount to delay after a Tap gesture is recognized, in case some u ser gesture
321 // --------------- 315 * immediately follows that would prevent the UI from showing.
316 * The classic example is a scroll, which might be a signal that the previou s tap was
317 * accidental.
318 * @return The delay in MS after the Tap before showing any UI.
319 */
320 static int getWaitAfterTapDelayMs() {
321 if (sWaitAfterTapDelayMs == null) {
322 sWaitAfterTapDelayMs = getIntParamValueOrDefault(WAIT_AFTER_TAP_DELA Y_MS, 0);
323 }
324 return sWaitAfterTapDelayMs.intValue();
325 }
326
327 // ---------------------------
328 // Feature-controlled Switches
329 // ---------------------------
322 330
323 /** 331 /**
324 * @return Whether or not single actions based on Contextual Cards is enable d. 332 * @return Whether or not single actions based on Contextual Cards is enable d.
325 */ 333 */
326 static boolean isContextualSearchSingleActionsEnabled() { 334 static boolean isContextualSearchSingleActionsEnabled() {
327 if (sContextualSearchSingleActionsEnabled == null) { 335 if (sContextualSearchSingleActionsEnabled == null) {
328 sContextualSearchSingleActionsEnabled = 336 sContextualSearchSingleActionsEnabled =
329 ChromeFeatureList.isEnabled(ChromeFeatureList.CONTEXTUAL_SEA RCH_SINGLE_ACTIONS); 337 ChromeFeatureList.isEnabled(ChromeFeatureList.CONTEXTUAL_SEA RCH_SINGLE_ACTIONS);
330 } 338 }
331 339
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 try { 387 try {
380 return Integer.parseInt(value); 388 return Integer.parseInt(value);
381 } catch (NumberFormatException e) { 389 } catch (NumberFormatException e) {
382 return defaultValue; 390 return defaultValue;
383 } 391 }
384 } 392 }
385 393
386 return defaultValue; 394 return defaultValue;
387 } 395 }
388 } 396 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698