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

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

Issue 2159923002: [TTS] Handle showing of a Context Menu more gracefully. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698