| 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.text.TextUtils; | 7 import android.text.TextUtils; |
| 8 import android.view.View; | 8 import android.view.View; |
| 9 import android.view.ViewGroup; | 9 import android.view.ViewGroup; |
| 10 import android.view.ViewTreeObserver; | 10 import android.view.ViewTreeObserver; |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 * is simply informative or descriptive of the answer in the full res
ults. | 744 * is simply informative or descriptive of the answer in the full res
ults. |
| 745 */ | 745 */ |
| 746 @CalledByNative | 746 @CalledByNative |
| 747 private void onSetCaption(String caption, boolean doesAnswer) { | 747 private void onSetCaption(String caption, boolean doesAnswer) { |
| 748 // Notify the UI of the caption. | 748 // Notify the UI of the caption. |
| 749 mSearchPanel.setCaption(caption); | 749 mSearchPanel.setCaption(caption); |
| 750 if (mQuickAnswersHeuristic != null) { | 750 if (mQuickAnswersHeuristic != null) { |
| 751 mQuickAnswersHeuristic.setConditionSatisfied(true); | 751 mQuickAnswersHeuristic.setConditionSatisfied(true); |
| 752 mQuickAnswersHeuristic.setDoesAnswer(doesAnswer); | 752 mQuickAnswersHeuristic.setDoesAnswer(doesAnswer); |
| 753 } | 753 } |
| 754 |
| 755 // Update Tap counters to account for a possible answer. |
| 756 mPolicy.updateCountersForQuickAnswer(mWasActivatedByTap, doesAnswer); |
| 754 } | 757 } |
| 755 | 758 |
| 756 /** | 759 /** |
| 757 * Notifies that the Accessibility Mode state has changed. | 760 * Notifies that the Accessibility Mode state has changed. |
| 758 * | 761 * |
| 759 * @param enabled Whether the Accessibility Mode is enabled. | 762 * @param enabled Whether the Accessibility Mode is enabled. |
| 760 */ | 763 */ |
| 761 public void onAccessibilityModeChanged(boolean enabled) { | 764 public void onAccessibilityModeChanged(boolean enabled) { |
| 762 mIsAccessibilityModeEnabled = enabled; | 765 mIsAccessibilityModeEnabled = enabled; |
| 763 } | 766 } |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 boolean maySendBasePageUrl); | 1358 boolean maySendBasePageUrl); |
| 1356 protected native void nativeGatherSurroundingText(long nativeContextualSearc
hManager, | 1359 protected native void nativeGatherSurroundingText(long nativeContextualSearc
hManager, |
| 1357 String selection, boolean useResolvedSearchTerm, ContentViewCore bas
eContentViewCore, | 1360 String selection, boolean useResolvedSearchTerm, ContentViewCore bas
eContentViewCore, |
| 1358 boolean maySendBasePageUrl); | 1361 boolean maySendBasePageUrl); |
| 1359 private native void nativeEnableContextualSearchJsApiForOverlay( | 1362 private native void nativeEnableContextualSearchJsApiForOverlay( |
| 1360 long nativeContextualSearchManager, ContentViewCore overlayContentVi
ewCore); | 1363 long nativeContextualSearchManager, ContentViewCore overlayContentVi
ewCore); |
| 1361 // Don't call these directly, instead call the private methods that cache th
e results. | 1364 // Don't call these directly, instead call the private methods that cache th
e results. |
| 1362 private native String nativeGetTargetLanguage(long nativeContextualSearchMan
ager); | 1365 private native String nativeGetTargetLanguage(long nativeContextualSearchMan
ager); |
| 1363 private native String nativeGetAcceptLanguages(long nativeContextualSearchMa
nager); | 1366 private native String nativeGetAcceptLanguages(long nativeContextualSearchMa
nager); |
| 1364 } | 1367 } |
| OLD | NEW |