| // Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module contextual_search.mojom; |
| |
| import "url/mojom/url.mojom"; |
| |
| // This service is implemented by the browser process and is used by the |
| // renderer when a Contextual Search JavaScript API function is called. |
| interface ContextualSearchJsApiService { |
| |
| // Determines if this JavaScript API should be enabled for the given URL. |
| // The asynchronous callback will be notified with the answer. |
| ShouldEnableJsApi(url.mojom.Url url) => (bool should_enable); |
| |
| // Handle a call from the JS API to set the caption, and indicate whether |
| // the caption provides an answer (such as an actual definition), rather than |
| // just general notification of what kind of answer may be available. |
| HandleSetCaption(string message, bool does_answer); |
| }; |