| OLD | NEW |
| 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.content.Context; | 7 import android.content.Context; |
| 8 | 8 |
| 9 import org.chromium.base.VisibleForTesting; | 9 import org.chromium.base.VisibleForTesting; |
| 10 import org.chromium.chrome.browser.ChromeVersionInfo; | 10 import org.chromium.chrome.browser.ChromeVersionInfo; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 * TODO(donnd): Update this API to definitively determine if it's OK to send
the URL, | 297 * TODO(donnd): Update this API to definitively determine if it's OK to send
the URL, |
| 298 * by merging the checks in the native contextual_search_delegate here. | 298 * by merging the checks in the native contextual_search_delegate here. |
| 299 * @return {@code true} if the URL may be sent for policy reasons. | 299 * @return {@code true} if the URL may be sent for policy reasons. |
| 300 * Note that a return value of {@code true} may still require additi
onal checks | 300 * Note that a return value of {@code true} may still require additi
onal checks |
| 301 * to see if all privacy-related conditions are met to send the base
page URL. | 301 * to see if all privacy-related conditions are met to send the base
page URL. |
| 302 */ | 302 */ |
| 303 boolean maySendBasePageUrl() { | 303 boolean maySendBasePageUrl() { |
| 304 return !isUserUndecided(); | 304 return !isUserUndecided(); |
| 305 } | 305 } |
| 306 | 306 |
| 307 /** |
| 308 * @return Whether Contextual Search should enable its API in the overlay pa
nel. |
| 309 */ |
| 310 boolean shouldEnableOverlayApi() { |
| 311 return ContextualSearchFieldTrial.isQuickAnswersEnabled(); |
| 312 } |
| 313 |
| 307 // -------------------------------------------------------------------------
------------------- | 314 // -------------------------------------------------------------------------
------------------- |
| 308 // Testing support. | 315 // Testing support. |
| 309 // -------------------------------------------------------------------------
------------------- | 316 // -------------------------------------------------------------------------
------------------- |
| 310 | 317 |
| 311 /** | 318 /** |
| 312 * Resets all policy counters. | 319 * Resets all policy counters. |
| 313 */ | 320 */ |
| 314 @VisibleForTesting | 321 @VisibleForTesting |
| 315 void resetCounters() { | 322 void resetCounters() { |
| 316 updateCountersForOpen(); | 323 updateCountersForOpen(); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 426 |
| 420 /** | 427 /** |
| 421 * @return The limit of the number of taps to resolve using search term reso
lution. | 428 * @return The limit of the number of taps to resolve using search term reso
lution. |
| 422 */ | 429 */ |
| 423 private int getTapResolveLimit() { | 430 private int getTapResolveLimit() { |
| 424 return isUserUndecided() | 431 return isUserUndecided() |
| 425 ? ContextualSearchFieldTrial.getTapResolveLimitForUndecided() | 432 ? ContextualSearchFieldTrial.getTapResolveLimitForUndecided() |
| 426 : ContextualSearchFieldTrial.getTapResolveLimitForDecided(); | 433 : ContextualSearchFieldTrial.getTapResolveLimitForDecided(); |
| 427 } | 434 } |
| 428 } | 435 } |
| OLD | NEW |