| OLD | NEW |
| 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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 | 14 |
| 15 class GURL; | 15 class GURL; |
| 16 class PrefRegistrySyncable; | |
| 17 class Profile; | 16 class Profile; |
| 18 class TemplateURL; | 17 class TemplateURL; |
| 19 class TemplateURLRef; | 18 class TemplateURLRef; |
| 20 | 19 |
| 21 namespace content { | 20 namespace content { |
| 22 class NavigationEntry; | 21 class NavigationEntry; |
| 23 class WebContents; | 22 class WebContents; |
| 24 } | 23 } |
| 25 | 24 |
| 25 namespace user_prefs { |
| 26 class PrefRegistrySyncable; |
| 27 } |
| 28 |
| 26 namespace chrome { | 29 namespace chrome { |
| 27 | 30 |
| 28 // Use this value for "start margin" to prevent the "es_sm" parameter from | 31 // Use this value for "start margin" to prevent the "es_sm" parameter from |
| 29 // being used. | 32 // being used. |
| 30 extern const int kDisableStartMargin; | 33 extern const int kDisableStartMargin; |
| 31 | 34 |
| 32 // Returns whether the Instant Extended API is enabled. | 35 // Returns whether the Instant Extended API is enabled. |
| 33 bool IsInstantExtendedAPIEnabled(); | 36 bool IsInstantExtendedAPIEnabled(); |
| 34 | 37 |
| 35 // Returns the value to pass to the &espv CGI parameter when loading the | 38 // Returns the value to pass to the &espv CGI parameter when loading the |
| (...skipping 29 matching lines...) Expand all Loading... |
| 65 // search provider but does not have any search terms is considered an Instant | 68 // search provider but does not have any search terms is considered an Instant |
| 66 // New Tab Page. | 69 // New Tab Page. |
| 67 bool IsInstantNTP(const content::WebContents* contents); | 70 bool IsInstantNTP(const content::WebContents* contents); |
| 68 | 71 |
| 69 // Same as IsInstantNTP but uses |nav_entry| to determine the URL for the page | 72 // Same as IsInstantNTP but uses |nav_entry| to determine the URL for the page |
| 70 // instead of using the visible entry. | 73 // instead of using the visible entry. |
| 71 bool NavEntryIsInstantNTP(const content::WebContents* contents, | 74 bool NavEntryIsInstantNTP(const content::WebContents* contents, |
| 72 const content::NavigationEntry* nav_entry); | 75 const content::NavigationEntry* nav_entry); |
| 73 | 76 |
| 74 // Registers Instant-related user preferences. Called at startup. | 77 // Registers Instant-related user preferences. Called at startup. |
| 75 void RegisterInstantUserPrefs(PrefRegistrySyncable* registry); | 78 void RegisterInstantUserPrefs(user_prefs::PrefRegistrySyncable* registry); |
| 76 | 79 |
| 77 // Returns prefs::kInstantExtendedEnabled in extended mode; | 80 // Returns prefs::kInstantExtendedEnabled in extended mode; |
| 78 // prefs::kInstantEnabled otherwise. | 81 // prefs::kInstantEnabled otherwise. |
| 79 const char* GetInstantPrefName(); | 82 const char* GetInstantPrefName(); |
| 80 | 83 |
| 81 // Sets the default value of prefs::kInstantExtendedEnabled, based on field | 84 // Sets the default value of prefs::kInstantExtendedEnabled, based on field |
| 82 // trials and the current value of prefs::kInstantEnabled. | 85 // trials and the current value of prefs::kInstantEnabled. |
| 83 void SetInstantExtendedPrefDefault(Profile* profile); | 86 void SetInstantExtendedPrefDefault(Profile* profile); |
| 84 | 87 |
| 85 // Returns whether the Instant checkbox in chrome://settings/ should be enabled | 88 // Returns whether the Instant checkbox in chrome://settings/ should be enabled |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 const TemplateURLRef& ref, | 191 const TemplateURLRef& ref, |
| 189 int start_margin); | 192 int start_margin); |
| 190 | 193 |
| 191 // Returns whether the default search provider has a valid Instant URL in its | 194 // Returns whether the default search provider has a valid Instant URL in its |
| 192 // template. Exposed for testing only. | 195 // template. Exposed for testing only. |
| 193 bool DefaultSearchProviderSupportsInstant(Profile* profile); | 196 bool DefaultSearchProviderSupportsInstant(Profile* profile); |
| 194 | 197 |
| 195 } // namespace chrome | 198 } // namespace chrome |
| 196 | 199 |
| 197 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 200 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
| OLD | NEW |