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.annotation.SuppressLint; | |
7 import android.os.Handler; | 8 import android.os.Handler; |
8 import android.text.TextUtils; | 9 import android.text.TextUtils; |
9 import android.view.View; | 10 import android.view.View; |
10 import android.view.ViewGroup; | 11 import android.view.ViewGroup; |
11 import android.view.ViewTreeObserver; | 12 import android.view.ViewTreeObserver; |
12 import android.view.ViewTreeObserver.OnGlobalFocusChangeListener; | 13 import android.view.ViewTreeObserver.OnGlobalFocusChangeListener; |
13 | 14 |
14 import org.chromium.base.ObserverList; | 15 import org.chromium.base.ObserverList; |
15 import org.chromium.base.SysUtils; | 16 import org.chromium.base.SysUtils; |
16 import org.chromium.base.VisibleForTesting; | 17 import org.chromium.base.VisibleForTesting; |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
628 final String searchTerm, final String displayText, final String alte rnateTerm, | 629 final String searchTerm, final String displayText, final String alte rnateTerm, |
629 final String mid, boolean doPreventPreload, int selectionStartAdjust , | 630 final String mid, boolean doPreventPreload, int selectionStartAdjust , |
630 int selectionEndAdjust, final String contextLanguage, final String t humbnailUrl, | 631 int selectionEndAdjust, final String contextLanguage, final String t humbnailUrl, |
631 final String caption, final String quickActionUri, final int quickAc tionCategory) { | 632 final String caption, final String quickActionUri, final int quickAc tionCategory) { |
632 mNetworkCommunicator.handleSearchTermResolutionResponse(isNetworkUnavail able, responseCode, | 633 mNetworkCommunicator.handleSearchTermResolutionResponse(isNetworkUnavail able, responseCode, |
633 searchTerm, displayText, alternateTerm, mid, doPreventPreload, s electionStartAdjust, | 634 searchTerm, displayText, alternateTerm, mid, doPreventPreload, s electionStartAdjust, |
634 selectionEndAdjust, contextLanguage, thumbnailUrl, caption, quic kActionUri, | 635 selectionEndAdjust, contextLanguage, thumbnailUrl, caption, quic kActionUri, |
635 quickActionCategory); | 636 quickActionCategory); |
636 } | 637 } |
637 | 638 |
639 // TODO(crbug.com/635567): Fix this properly. | |
Ted C
2017/04/27 19:02:47
move to the line that is wrong.
F
2017/04/28 18:25:14
Done.
| |
640 @SuppressLint("StringFormatMatches") | |
638 @Override | 641 @Override |
639 public void handleSearchTermResolutionResponse(boolean isNetworkUnavailable, int responseCode, | 642 public void handleSearchTermResolutionResponse(boolean isNetworkUnavailable, int responseCode, |
640 String searchTerm, String displayText, String alternateTerm, String mid, | 643 String searchTerm, String displayText, String alternateTerm, String mid, |
641 boolean doPreventPreload, int selectionStartAdjust, int selectionEnd Adjust, | 644 boolean doPreventPreload, int selectionStartAdjust, int selectionEnd Adjust, |
642 String contextLanguage, String thumbnailUrl, String caption, String quickActionUri, | 645 String contextLanguage, String thumbnailUrl, String caption, String quickActionUri, |
643 int quickActionCategory) { | 646 int quickActionCategory) { |
644 if (!mInternalStateController.isStillWorkingOn(InternalState.RESOLVING)) return; | 647 if (!mInternalStateController.isStillWorkingOn(InternalState.RESOLVING)) return; |
645 | 648 |
646 // Show an appropriate message for what to search for. | 649 // Show an appropriate message for what to search for. |
647 String message; | 650 String message; |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1566 private native void nativeStartSearchTermResolutionRequest(long nativeContex tualSearchManager, | 1569 private native void nativeStartSearchTermResolutionRequest(long nativeContex tualSearchManager, |
1567 ContextualSearchContext contextualSearchContext, WebContents baseWeb Contents); | 1570 ContextualSearchContext contextualSearchContext, WebContents baseWeb Contents); |
1568 protected native void nativeGatherSurroundingText(long nativeContextualSearc hManager, | 1571 protected native void nativeGatherSurroundingText(long nativeContextualSearc hManager, |
1569 ContextualSearchContext contextualSearchContext, WebContents baseWeb Contents); | 1572 ContextualSearchContext contextualSearchContext, WebContents baseWeb Contents); |
1570 private native void nativeEnableContextualSearchJsApiForOverlay( | 1573 private native void nativeEnableContextualSearchJsApiForOverlay( |
1571 long nativeContextualSearchManager, WebContents overlayWebContents); | 1574 long nativeContextualSearchManager, WebContents overlayWebContents); |
1572 // Don't call these directly, instead call the private methods that cache th e results. | 1575 // Don't call these directly, instead call the private methods that cache th e results. |
1573 private native String nativeGetTargetLanguage(long nativeContextualSearchMan ager); | 1576 private native String nativeGetTargetLanguage(long nativeContextualSearchMan ager); |
1574 private native String nativeGetAcceptLanguages(long nativeContextualSearchMa nager); | 1577 private native String nativeGetAcceptLanguages(long nativeContextualSearchMa nager); |
1575 } | 1578 } |
OLD | NEW |