| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_UI_SEARCH_SEARCH_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Returns search terms if this WebContents is a search results page. It looks | 66 // Returns search terms if this WebContents is a search results page. It looks |
| 67 // in the visible NavigationEntry first, to see if search terms have already | 67 // in the visible NavigationEntry first, to see if search terms have already |
| 68 // been extracted. Failing that, it tries to extract search terms from the URL. | 68 // been extracted. Failing that, it tries to extract search terms from the URL. |
| 69 // Returns a blank string if search terms were not found, or if search terms | 69 // Returns a blank string if search terms were not found, or if search terms |
| 70 // extraction is disabled for this WebContents or profile. | 70 // extraction is disabled for this WebContents or profile. |
| 71 string16 GetSearchTerms(const content::WebContents* contents); | 71 string16 GetSearchTerms(const content::WebContents* contents); |
| 72 | 72 |
| 73 // Returns true if |url| should be rendered in the Instant renderer process. | 73 // Returns true if |url| should be rendered in the Instant renderer process. |
| 74 bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile); | 74 bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile); |
| 75 | 75 |
| 76 // Record the InstantExtended pref value for UMA. |
| 77 void RecordInstantExtendedPrefValue(bool pref_value); |
| 78 |
| 76 // ----------------------------------------------------- | 79 // ----------------------------------------------------- |
| 77 // The following APIs are exposed for use in tests only. | 80 // The following APIs are exposed for use in tests only. |
| 78 // ----------------------------------------------------- | 81 // ----------------------------------------------------- |
| 79 | 82 |
| 80 // Forces the Instant Extended API to be enabled for tests. | 83 // Forces the Instant Extended API to be enabled for tests. |
| 81 void EnableInstantExtendedAPIForTesting(); | 84 void EnableInstantExtendedAPIForTesting(); |
| 82 | 85 |
| 83 // Forces query extraction to be enabled for tests. | 86 // Forces query extraction to be enabled for tests. |
| 84 void EnableQueryExtractionForTesting(); | 87 void EnableQueryExtractionForTesting(); |
| 85 | 88 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 128 |
| 126 // Coerces the commandline Instant URL to look like a template URL, so that we | 129 // Coerces the commandline Instant URL to look like a template URL, so that we |
| 127 // can extract search terms from it. | 130 // can extract search terms from it. |
| 128 GURL CoerceCommandLineURLToTemplateURL(const GURL& instant_url, | 131 GURL CoerceCommandLineURLToTemplateURL(const GURL& instant_url, |
| 129 const TemplateURLRef& ref); | 132 const TemplateURLRef& ref); |
| 130 | 133 |
| 131 } // namespace search | 134 } // namespace search |
| 132 } // namespace chrome | 135 } // namespace chrome |
| 133 | 136 |
| 134 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_H_ | 137 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_H_ |
| OLD | NEW |