| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 } | 302 } |
| 303 | 303 |
| 304 /** | 304 /** |
| 305 * Notifies that the base page has started loading a page. | 305 * Notifies that the base page has started loading a page. |
| 306 */ | 306 */ |
| 307 public void onBasePageLoadStarted() { | 307 public void onBasePageLoadStarted() { |
| 308 mSelectionController.onBasePageLoadStarted(); | 308 mSelectionController.onBasePageLoadStarted(); |
| 309 } | 309 } |
| 310 | 310 |
| 311 /** | 311 /** |
| 312 * Notifies that a Context Menu has been shown. |
| 313 */ |
| 314 void onContextMenuShown() { |
| 315 mSelectionController.onContextMenuShown(); |
| 316 } |
| 317 |
| 318 /** |
| 312 * Hides the Contextual Search UX. | 319 * Hides the Contextual Search UX. |
| 313 * @param reason The {@link StateChangeReason} for hiding Contextual Search. | 320 * @param reason The {@link StateChangeReason} for hiding Contextual Search. |
| 314 */ | 321 */ |
| 315 public void hideContextualSearch(StateChangeReason reason) { | 322 public void hideContextualSearch(StateChangeReason reason) { |
| 316 if (mSearchPanel == null) return; | 323 if (mSearchPanel == null) return; |
| 317 | 324 |
| 318 if (mSearchPanel.isShowing()) { | 325 if (mSearchPanel.isShowing()) { |
| 319 mSearchPanel.closePanel(reason, false); | 326 mSearchPanel.closePanel(reason, false); |
| 320 } else { | 327 } else { |
| 321 if (mSelectionController.getSelectionType() == SelectionType.TAP) { | 328 if (mSelectionController.getSelectionType() == SelectionType.TAP) { |
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 boolean maySendBasePageUrl); | 1367 boolean maySendBasePageUrl); |
| 1361 protected native void nativeGatherSurroundingText(long nativeContextualSearc
hManager, | 1368 protected native void nativeGatherSurroundingText(long nativeContextualSearc
hManager, |
| 1362 String selection, boolean useResolvedSearchTerm, ContentViewCore bas
eContentViewCore, | 1369 String selection, boolean useResolvedSearchTerm, ContentViewCore bas
eContentViewCore, |
| 1363 boolean maySendBasePageUrl); | 1370 boolean maySendBasePageUrl); |
| 1364 private native void nativeEnableContextualSearchJsApiForOverlay( | 1371 private native void nativeEnableContextualSearchJsApiForOverlay( |
| 1365 long nativeContextualSearchManager, ContentViewCore overlayContentVi
ewCore); | 1372 long nativeContextualSearchManager, ContentViewCore overlayContentVi
ewCore); |
| 1366 // Don't call these directly, instead call the private methods that cache th
e results. | 1373 // Don't call these directly, instead call the private methods that cache th
e results. |
| 1367 private native String nativeGetTargetLanguage(long nativeContextualSearchMan
ager); | 1374 private native String nativeGetTargetLanguage(long nativeContextualSearchMan
ager); |
| 1368 private native String nativeGetAcceptLanguages(long nativeContextualSearchMa
nager); | 1375 private native String nativeGetAcceptLanguages(long nativeContextualSearchMa
nager); |
| 1369 } | 1376 } |
| OLD | NEW |