1// Copyright 2020 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// Use the <code>chrome.search</code> API to search via the default provider. 6namespace search { 7 enum Disposition { 8 // Display results in the calling tab or the tab from the active browser. 9 CURRENT_TAB, 10 11 // Display search results in a new tab. 12 NEW_TAB, 13 14 // Display search results in a new window. 15 NEW_WINDOW 16 }; 17 18 dictionary QueryInfo { 19 // String to query with the default search provider. 20 DOMString text; 21 22 // Location where search results should be displayed. 23 // <code>CURRENT_TAB</code> is the default. 24 Disposition? disposition; 25 26 // Location where search results should be displayed. 27 // <code>tabId<code> cannot be used with <code>disposition</code>. 28 long? tabId; 29 }; 30 31 callback QueryCallback = void(); 32 33 interface Functions { 34 // Used to query the default search provider. 35 // In case of an error, 36 // $(ref:runtime.lastError) will be set. 37 static void query(QueryInfo queryInfo, optional QueryCallback callback); 38 }; 39}; 40