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

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

Issue 2651763002: Cleanup in components/search and chrome/browser/search (Closed)
Patch Set: for each Created 3 years, 10 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
« no previous file with comments | « chrome/browser/search/instant_service.cc ('k') | chrome/browser/search/search.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 CHROME_BROWSER_SEARCH_SEARCH_H_ 5 #ifndef CHROME_BROWSER_SEARCH_SEARCH_H_
6 #define CHROME_BROWSER_SEARCH_SEARCH_H_ 6 #define CHROME_BROWSER_SEARCH_SEARCH_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 18 matching lines...) Expand all
29 CACHEABLE_NTP_LOAD_SUCCEEDED = 1, 29 CACHEABLE_NTP_LOAD_SUCCEEDED = 1,
30 CACHEABLE_NTP_LOAD_MAX = 2 30 CACHEABLE_NTP_LOAD_MAX = 2
31 }; 31 };
32 32
33 // Returns whether the suggest is enabled for the given |profile|. 33 // Returns whether the suggest is enabled for the given |profile|.
34 bool IsSuggestPrefEnabled(Profile* profile); 34 bool IsSuggestPrefEnabled(Profile* profile);
35 35
36 // Extracts and returns search terms from |url|. 36 // Extracts and returns search terms from |url|.
37 base::string16 ExtractSearchTermsFromURL(Profile* profile, const GURL& url); 37 base::string16 ExtractSearchTermsFromURL(Profile* profile, const GURL& url);
38 38
39 // Returns true if it is okay to extract search terms from |url|. |url| must
40 // have a secure scheme and must contain the search terms replacement key for
41 // the default search provider.
42 bool IsQueryExtractionAllowedForURL(Profile* profile, const GURL& url);
43
44 // Returns true if |url| should be rendered in the Instant renderer process. 39 // Returns true if |url| should be rendered in the Instant renderer process.
45 bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile); 40 bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile);
46 41
47 // Returns true if |contents| is rendered inside the Instant process for 42 // Returns true if |contents| is rendered inside the Instant process for
48 // |profile|. 43 // |profile|.
49 bool IsRenderedInInstantProcess(const content::WebContents* contents, 44 bool IsRenderedInInstantProcess(const content::WebContents* contents,
50 Profile* profile); 45 Profile* profile);
51 46
52 // Returns true if the Instant |url| should use process per site. 47 // Returns true if the Instant |url| should use process per site.
53 bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile); 48 bool ShouldUseProcessPerSiteForInstantURL(const GURL& url, Profile* profile);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // Rewrites |url| to the actual NTP URL to use if 113 // Rewrites |url| to the actual NTP URL to use if
119 // 1. |url| is "chrome://newtab", 114 // 1. |url| is "chrome://newtab",
120 // 2. InstantExtended is enabled, and 115 // 2. InstantExtended is enabled, and
121 // 3. |browser_context| doesn't correspond to an incognito profile. 116 // 3. |browser_context| doesn't correspond to an incognito profile.
122 bool HandleNewTabURLRewrite(GURL* url, 117 bool HandleNewTabURLRewrite(GURL* url,
123 content::BrowserContext* browser_context); 118 content::BrowserContext* browser_context);
124 // Reverses the operation from HandleNewTabURLRewrite. 119 // Reverses the operation from HandleNewTabURLRewrite.
125 bool HandleNewTabURLReverseRewrite(GURL* url, 120 bool HandleNewTabURLReverseRewrite(GURL* url,
126 content::BrowserContext* browser_context); 121 content::BrowserContext* browser_context);
127 122
128 // -----------------------------------------------------
129 // The following APIs are exposed for use in tests only.
130 // -----------------------------------------------------
131
132 // Returns the Cacheable New Tab Page URL for the given |profile|. 123 // Returns the Cacheable New Tab Page URL for the given |profile|.
133 GURL GetNewTabPageURL(Profile* profile); 124 GURL GetNewTabPageURL(Profile* profile);
134 125
135 } // namespace search 126 } // namespace search
136 127
137 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ 128 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_
OLDNEW
« no previous file with comments | « chrome/browser/search/instant_service.cc ('k') | chrome/browser/search/search.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698