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

Side by Side Diff: ios/chrome/browser/search/search_util.h

Issue 1260033003: Partially componentize //chrome/browser/search/search.{h,cc} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on iOS 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
(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_CHROME_BROWSER_SEARCH_SEARCH_UTIL_H_
6 #define IOS_CHROME_BROWSER_SEARCH_SEARCH_UTIL_H_
7
8 #include "base/strings/string16.h"
9
10 class GURL;
11
12 namespace ios {
13 class ChromeBrowserState;
14 }
15
16 namespace web {
17 class WebState;
18 }
19
20 // Extracts and returns search terms from |url|. Does not consider
21 // IsQueryExtractionEnabled() and Instant support state of the page and does
22 // not check for a privileged process, so most callers should use
23 // GetSearchTerms() below instead.
24 base::string16 ExtractSearchTermsFromURL(ios::ChromeBrowserState* browser_state,
25 const GURL& url);
26
27 // Returns true if it is okay to extract search terms from |url|. |url| must
28 // have a secure scheme and must contain the search terms replacement key for
29 // the default search provider.
30 bool IsQueryExtractionAllowedForURL(ios::ChromeBrowserState* browser_state,
31 const GURL& url);
32
33 // Returns search terms if this WebState is a search results page. It looks
34 // in the visible NavigationItem first, to see if search terms have already
35 // been extracted. Failing that, it tries to extract search terms from the URL.
36 //
37 // Returns a blank string if search terms were not found, or if search terms
38 // extraction is disabled for this WebState or BrowserState, or if |web_state|
39 // does not support Instant.
40 base::string16 GetSearchTerms(web::WebState* web_state);
41
42 #endif // IOS_CHROME_BROWSER_SEARCH_SEARCH_UTIL_H_
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.cc ('k') | ios/chrome/browser/search/search_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698