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

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

Issue 2348443002: Revert of [TTS] Gather surrounding text on Tap before any UX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.contextualsearch.action;
6
7 import org.chromium.chrome.browser.contextualsearch.gesture.SearchGestureHost;
8
9 /**
10 * Represents a Search Action that will gather and examine surrounding text in o rder to
11 * "resolve" what to search for.
12 * Right now this class is just being used to extract surrounding context for a tap
13 * action before issuing the resolution request to determine if we want to suppr ess
14 * the tap. Longer term it will actually do the resolution request & search requ est.
15 * This is part of the 2016-refactoring (crbug.com/624609, go/cs-refactoring-201 6).
16 */
17 public class ResolvedSearchAction extends SearchAction {
18 // ========================================================================= ===================
19 // Constructor
20 // ========================================================================= ===================
21
22 /**
23 * Constructs a Search Action that extracts context for a Tap, using the giv en listener and
24 * host. Current implementation is limited to gathering the text surrounding a Tap gesture in
25 * order to determine whether a search should be done or not.
26 * @param listener The object to notify when the {@link SearchAction} state changes.
27 * @param host The host that provides environment data to the {@link SearchA ction}.
28 */
29 public ResolvedSearchAction(SearchActionListener listener, SearchGestureHost host) {
30 super(listener, host);
31 }
32
33 // ========================================================================= ===================
34 // Abstract implementations
35 // ========================================================================= ===================
36
37 @Override
38 public void extractContext() {
39 requestSurroundingText();
40 }
41
42 // ========================================================================= ===================
43 // State handling
44 // ========================================================================= ===================
45
46 @Override
47 protected void onSurroundingTextReady() {
48 super.onSurroundingTextReady();
49
50 notifyContextReady();
51 }
52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698