OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SEARCH_PROVIDER_H_ | |
6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SEARCH_PROVIDER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 | |
12 namespace ios { | |
13 | |
14 // SearchProvider provides accessor for search features not yet componentized. | |
15 class SearchProvider { | |
16 public: | |
17 SearchProvider() {} | |
18 virtual ~SearchProvider() {} | |
19 | |
20 // Returns whether query extraction is enabled. | |
21 virtual bool IsQueryExtractionEnabled() = 0; | |
22 | |
23 // Returns a string indicating whether InstantExtended is enabled, suitable | |
24 // for adding as a query parameter to the search requests. Returns an empty | |
25 // string otherwise. | |
26 // | |
27 // |for_search| should be set to true for search requests, in which case this | |
28 // returns a non-empty string only if query extraction is enabled. | |
29 virtual std::string InstantExtendedEnabledParam(bool for_search) = 0; | |
30 | |
31 // Returns a string that will cause the search results page to update | |
32 // incrementally. Currently, Instant Extended passes a different param to | |
33 // search results pages that also has this effect, so by default this function | |
34 // returns the empty string when Instant Extended is enabled. However, when | |
35 // doing instant search result prerendering, we still need to pass this param, | |
36 // as Instant Extended does not cause incremental updates by default for the | |
37 // prerender page. Callers should set |for_prerender| in this case to force | |
38 // the returned string to be non-empty. | |
39 virtual std::string ForceInstantResultsParam(bool for_prerender) = 0; | |
40 | |
41 // Returns the start-edge margin of the omnibox in pixels. | |
42 virtual int OmniboxStartMargin() = 0; | |
43 | |
44 private: | |
45 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | |
46 }; | |
47 | |
48 } // namespace | |
49 | |
50 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SEARCH_PROVIDER_H_ | |
OLD | NEW |