OLD | NEW |
(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 public ResolvedSearchAction(SearchActionListener listener, SearchGestureHost
host) { |
| 23 super(listener, host); |
| 24 } |
| 25 |
| 26 // =========================================================================
=================== |
| 27 // Abstract implementations |
| 28 // =========================================================================
=================== |
| 29 |
| 30 @Override |
| 31 public void extractContext() { |
| 32 requestSurroundingText(); |
| 33 } |
| 34 |
| 35 // =========================================================================
=================== |
| 36 // State handling |
| 37 // =========================================================================
=================== |
| 38 |
| 39 @Override |
| 40 protected void onSurroundingTextResponse() { |
| 41 super.onSurroundingTextResponse(); |
| 42 |
| 43 notifyContextReady(); |
| 44 } |
| 45 } |
OLD | NEW |