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> |
(...skipping 30 matching lines...) Expand all Loading... |
41 }; | 41 }; |
42 | 42 |
43 enum DisplaySearchButtonConditions { | 43 enum DisplaySearchButtonConditions { |
44 DISPLAY_SEARCH_BUTTON_NEVER, | 44 DISPLAY_SEARCH_BUTTON_NEVER, |
45 DISPLAY_SEARCH_BUTTON_FOR_STR, // STR = Search Term Replacement | 45 DISPLAY_SEARCH_BUTTON_FOR_STR, // STR = Search Term Replacement |
46 DISPLAY_SEARCH_BUTTON_FOR_STR_OR_IIP, // IIP = Input In Progress | 46 DISPLAY_SEARCH_BUTTON_FOR_STR_OR_IIP, // IIP = Input In Progress |
47 DISPLAY_SEARCH_BUTTON_ALWAYS, | 47 DISPLAY_SEARCH_BUTTON_ALWAYS, |
48 DISPLAY_SEARCH_BUTTON_NUM_VALUES, | 48 DISPLAY_SEARCH_BUTTON_NUM_VALUES, |
49 }; | 49 }; |
50 | 50 |
| 51 enum OriginChipPosition { |
| 52 ORIGIN_CHIP_DISABLED, |
| 53 ORIGIN_CHIP_LEFT_OF_LOCATION_BAR, |
| 54 ORIGIN_CHIP_RIGHT_OF_LOCATION_BAR, |
| 55 ORIGIN_CHIP_LEFT_OF_MENU, |
| 56 ORIGIN_CHIP_NUM_VALUES, |
| 57 }; |
| 58 |
51 // Use this value for "start margin" to prevent the "es_sm" parameter from | 59 // Use this value for "start margin" to prevent the "es_sm" parameter from |
52 // being used. | 60 // being used. |
53 extern const int kDisableStartMargin; | 61 extern const int kDisableStartMargin; |
54 | 62 |
55 // Returns whether the Instant Extended API is enabled. | 63 // Returns whether the Instant Extended API is enabled. |
56 bool IsInstantExtendedAPIEnabled(); | 64 bool IsInstantExtendedAPIEnabled(); |
57 | 65 |
58 // Returns whether the suggest is enabled for the given |profile|. | 66 // Returns whether the suggest is enabled for the given |profile|. |
59 bool IsSuggestPrefEnabled(Profile* profile); | 67 bool IsSuggestPrefEnabled(Profile* profile); |
60 | 68 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 160 |
153 // Returns true if the Instant NTP should be shown and false if not. | 161 // Returns true if the Instant NTP should be shown and false if not. |
154 bool ShouldShowInstantNTP(); | 162 bool ShouldShowInstantNTP(); |
155 | 163 |
156 // Returns when we should show a search button in the omnibox. This may be any | 164 // Returns when we should show a search button in the omnibox. This may be any |
157 // of several values, some of which depend on whether the underlying state of | 165 // of several values, some of which depend on whether the underlying state of |
158 // the page would normally be to perform search term replacement; see also | 166 // the page would normally be to perform search term replacement; see also |
159 // ToolbarModel::WouldPerformSearchTermReplacement(). | 167 // ToolbarModel::WouldPerformSearchTermReplacement(). |
160 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); | 168 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); |
161 | 169 |
162 // Returns true if the origin chip should be shown next to the omnibox. This | 170 // Returns true if the origin chip should be shown in the toolbar. This |
163 // also includes the related changes to the omnibox. | 171 // also includes the related changes to the omnibox. |
164 bool ShouldDisplayOriginChip(); | 172 bool ShouldDisplayOriginChip(); |
165 | 173 |
| 174 // Returns a value indicating where the origin chip should be positioned on the |
| 175 // toolbar. |
| 176 OriginChipPosition GetOriginChipPosition(); |
| 177 |
166 // Transforms the input |url| into its "effective URL". The returned URL | 178 // Transforms the input |url| into its "effective URL". The returned URL |
167 // facilitates grouping process-per-site. The |url| is transformed, for | 179 // facilitates grouping process-per-site. The |url| is transformed, for |
168 // example, from | 180 // example, from |
169 // | 181 // |
170 // https://www.google.com/search?espv=1&q=tractors | 182 // https://www.google.com/search?espv=1&q=tractors |
171 // | 183 // |
172 // to the privileged URL | 184 // to the privileged URL |
173 // | 185 // |
174 // chrome-search://www.google.com/search?espv=1&q=tractors | 186 // chrome-search://www.google.com/search?espv=1&q=tractors |
175 // | 187 // |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 bool GetBoolValueForFlagWithDefault(const std::string& flag, | 262 bool GetBoolValueForFlagWithDefault(const std::string& flag, |
251 bool default_value, | 263 bool default_value, |
252 const FieldTrialFlags& flags); | 264 const FieldTrialFlags& flags); |
253 | 265 |
254 // Returns the Cacheable New Tab Page URL for the given |profile|. | 266 // Returns the Cacheable New Tab Page URL for the given |profile|. |
255 GURL GetNewTabPageURL(Profile* profile); | 267 GURL GetNewTabPageURL(Profile* profile); |
256 | 268 |
257 } // namespace chrome | 269 } // namespace chrome |
258 | 270 |
259 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 271 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
OLD | NEW |