| 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.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Interface to a content layer client that can process and modify selection tex
t. | 8 * Interface to a content layer client that can process and modify selection tex
t. |
| 9 */ | 9 */ |
| 10 public interface SelectionClient { | 10 public interface SelectionClient { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 void onSelectionEvent(int eventType, float posXPix, float posYPix); | 23 void onSelectionEvent(int eventType, float posXPix, float posYPix); |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * Requests to show the UI for an unhandled tap, if needed. | 26 * Requests to show the UI for an unhandled tap, if needed. |
| 27 * @param x The x coordinate of the tap. | 27 * @param x The x coordinate of the tap. |
| 28 * @param y The y coordinate of the tap. | 28 * @param y The y coordinate of the tap. |
| 29 */ | 29 */ |
| 30 void showUnhandledTapUIIfNeeded(int x, int y); | 30 void showUnhandledTapUIIfNeeded(int x, int y); |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * Acknowledges that a selectWordAroundCaret action has completed with the g
iven result. |
| 34 * @param didSelect Whether a word was actually selected or not. |
| 35 * @param startAdjust The adjustment to the selection start offset needed to
select the word. |
| 36 * This is typically a negative number (expressed in terms of number
of characters). |
| 37 * @param endAdjust The adjustment to the selection end offset needed to sel
ect the word. |
| 38 * This is typically a positive number (expressed in terms of number
of characters). |
| 39 */ |
| 40 void selectWordAroundCaretAck(boolean didSelect, int startAdjust, int endAdj
ust); |
| 41 |
| 42 /** |
| 33 * Notifies the SelectionClient that the selection menu has been requested. | 43 * Notifies the SelectionClient that the selection menu has been requested. |
| 34 * @param shouldSuggest Whether SelectionClient should suggest and classify
or just classify. | 44 * @param shouldSuggest Whether SelectionClient should suggest and classify
or just classify. |
| 35 * @return True if embedder should wait for a response before showing select
ion menu. | 45 * @return True if embedder should wait for a response before showing select
ion menu. |
| 36 */ | 46 */ |
| 37 boolean requestSelectionPopupUpdates(boolean shouldSuggest); | 47 boolean requestSelectionPopupUpdates(boolean shouldSuggest); |
| 38 | 48 |
| 39 /** | 49 /** |
| 40 * Cancel any outstanding requests the embedder had previously requested usi
ng | 50 * Cancel any outstanding requests the embedder had previously requested usi
ng |
| 41 * SelectionClient.requestSelectionPopupUpdates(). | 51 * SelectionClient.requestSelectionPopupUpdates(). |
| 42 */ | 52 */ |
| 43 public void cancelAllRequests(); | 53 public void cancelAllRequests(); |
| 44 | 54 |
| 45 /** | 55 /** |
| 46 * Acknowledges that a selectWordAroundCaret action has completed with the g
iven result. | 56 * Sets TextClassifier for the Smart Text selection. Pass null argument to u
se the system |
| 47 * @param didSelect Whether a word was actually selected or not. | 57 * classifier |
| 48 * @param startAdjust The adjustment to the selection start offset needed to
select the word. | |
| 49 * This is typically a negative number (expressed in terms of number
of characters). | |
| 50 * @param endAdjust The adjustment to the selection end offset needed to sel
ect the word. | |
| 51 * This is typically a positive number (expressed in terms of number
of characters). | |
| 52 */ | 58 */ |
| 53 void selectWordAroundCaretAck(boolean didSelect, int startAdjust, int endAdj
ust); | 59 public void setTextClassifier(Object textClassifier); |
| 60 |
| 61 /** |
| 62 * Gets TextClassifier that is used for the Smart Text selection. If the cus
tom classifier |
| 63 * has been set with setTextClassifier, returns that object, otherwise retur
ns the system |
| 64 * classifier. |
| 65 */ |
| 66 public Object getTextClassifier(); |
| 67 |
| 68 /** |
| 69 * Returns the TextClassifier which has been set with setTextClassifier(), o
r null. |
| 70 */ |
| 71 public Object getCustomTextClassifier(); |
| 54 } | 72 } |
| OLD | NEW |