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

Side by Side Diff: ios/public/provider/chrome/browser/search_provider.h

Issue 1260033003: Partially componentize //chrome/browser/search/search.{h,cc} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SEARCH_PROVIDER_H_ 5 #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SEARCH_PROVIDER_H_
6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SEARCH_PROVIDER_H_ 6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SEARCH_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 11
12 namespace ios { 12 namespace ios {
13 13
14 // SearchProvider provides accessor for search features not yet componentized. 14 // SearchProvider provides accessor for search features not yet componentized.
15 class SearchProvider { 15 class SearchProvider {
16 public: 16 public:
17 SearchProvider() {} 17 SearchProvider() {}
18 virtual ~SearchProvider() {} 18 virtual ~SearchProvider() {}
19 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 // Returns the value to use for replacements of type 20 // Returns the value to use for replacements of type
45 // GOOGLE_IMAGE_SEARCH_SOURCE. 21 // GOOGLE_IMAGE_SEARCH_SOURCE.
46 virtual std::string GoogleImageSearchSource() = 0; 22 virtual std::string GoogleImageSearchSource() = 0;
47 23
48 private: 24 private:
49 DISALLOW_COPY_AND_ASSIGN(SearchProvider); 25 DISALLOW_COPY_AND_ASSIGN(SearchProvider);
50 }; 26 };
51 27
52 } // namespace 28 } // namespace
53 29
54 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SEARCH_PROVIDER_H_ 30 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SEARCH_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698