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 { | 51 enum OriginChipCondition { |
52 ORIGIN_CHIP_DISABLED, | 52 ORIGIN_CHIP_DISABLED = 0, |
53 ORIGIN_CHIP_LEADING_LOCATION_BAR, | 53 ORIGIN_CHIP_ALWAYS, |
54 ORIGIN_CHIP_TRAILING_LOCATION_BAR, | 54 ORIGIN_CHIP_ON_SRP, |
55 ORIGIN_CHIP_LEADING_MENU_BUTTON, | |
56 ORIGIN_CHIP_NUM_VALUES, | 55 ORIGIN_CHIP_NUM_VALUES, |
57 }; | 56 }; |
58 | 57 |
59 enum OriginChipV2Condition { | |
60 ORIGIN_CHIP_V2_DISABLED, | |
61 ORIGIN_CHIP_V2_HIDE_ON_MOUSE_RELEASE, | |
62 ORIGIN_CHIP_V2_HIDE_ON_USER_INPUT, | |
63 ORIGIN_CHIP_V2_ON_SRP, | |
64 ORIGIN_CHIP_V2_NUM_VALUES, | |
65 }; | |
66 | |
67 // Use this value for "start margin" to prevent the "es_sm" parameter from | 58 // Use this value for "start margin" to prevent the "es_sm" parameter from |
68 // being used. | 59 // being used. |
69 extern const int kDisableStartMargin; | 60 extern const int kDisableStartMargin; |
70 | 61 |
71 // Returns whether the Instant Extended API is enabled. | 62 // Returns whether the Instant Extended API is enabled. |
72 bool IsInstantExtendedAPIEnabled(); | 63 bool IsInstantExtendedAPIEnabled(); |
73 | 64 |
74 // Returns whether the suggest is enabled for the given |profile|. | 65 // Returns whether the suggest is enabled for the given |profile|. |
75 bool IsSuggestPrefEnabled(Profile* profile); | 66 bool IsSuggestPrefEnabled(Profile* profile); |
76 | 67 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // to hide the top match in the native suggestions dropdown if it is a verbatim | 178 // to hide the top match in the native suggestions dropdown if it is a verbatim |
188 // match. See comments on ShouldHideTopMatch in autocomplete_result.h. | 179 // match. See comments on ShouldHideTopMatch in autocomplete_result.h. |
189 bool ShouldHideTopVerbatimMatch(); | 180 bool ShouldHideTopVerbatimMatch(); |
190 | 181 |
191 // Returns when we should show a search button in the omnibox. This may be any | 182 // Returns when we should show a search button in the omnibox. This may be any |
192 // of several values, some of which depend on whether the underlying state of | 183 // of several values, some of which depend on whether the underlying state of |
193 // the page would normally be to perform search term replacement; see also | 184 // the page would normally be to perform search term replacement; see also |
194 // ToolbarModel::WouldPerformSearchTermReplacement(). | 185 // ToolbarModel::WouldPerformSearchTermReplacement(). |
195 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); | 186 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); |
196 | 187 |
197 // Returns true if the origin chip should be shown in the toolbar. This | 188 // Returns true if the origin chip should be shown. |
198 // also includes the related changes to the omnibox. Always returns false if | |
199 // ShouldDisplayOriginChipV2() returns true. | |
200 bool ShouldDisplayOriginChip(); | 189 bool ShouldDisplayOriginChip(); |
201 | 190 |
202 // Returns a value indicating where the origin chip should be positioned on the | 191 // Returns a value indicating when the origin chip should be shown. |
203 // toolbar. | 192 OriginChipCondition GetOriginChipCondition(); |
204 OriginChipPosition GetOriginChipPosition(); | |
205 | |
206 // Returns true if version 2 of the origin chip should be shown. This version | |
207 // places the origin chip inside the location bar instead of the toolbar and | |
208 // adds show/hide behavior and animations to make the relationship between the | |
209 // chip and the text in the Omnibox clearer. | |
210 bool ShouldDisplayOriginChipV2(); | |
211 | |
212 // Returns a value indicating what event should trigger hiding the origin chip | |
213 // in the location bar. | |
214 OriginChipV2Condition GetOriginChipV2Condition(); | |
215 | 193 |
216 // Returns true if the local new tab page should show a Google logo and search | 194 // Returns true if the local new tab page should show a Google logo and search |
217 // box for users whose default search provider is Google, or false if not. | 195 // box for users whose default search provider is Google, or false if not. |
218 bool ShouldShowGoogleLocalNTP(); | 196 bool ShouldShowGoogleLocalNTP(); |
219 | 197 |
220 // Transforms the input |url| into its "effective URL". The returned URL | 198 // Transforms the input |url| into its "effective URL". The returned URL |
221 // facilitates grouping process-per-site. The |url| is transformed, for | 199 // facilitates grouping process-per-site. The |url| is transformed, for |
222 // example, from | 200 // example, from |
223 // | 201 // |
224 // https://www.google.com/search?espv=1&q=tractors | 202 // https://www.google.com/search?espv=1&q=tractors |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 bool GetBoolValueForFlagWithDefault(const std::string& flag, | 275 bool GetBoolValueForFlagWithDefault(const std::string& flag, |
298 bool default_value, | 276 bool default_value, |
299 const FieldTrialFlags& flags); | 277 const FieldTrialFlags& flags); |
300 | 278 |
301 // Returns the Cacheable New Tab Page URL for the given |profile|. | 279 // Returns the Cacheable New Tab Page URL for the given |profile|. |
302 GURL GetNewTabPageURL(Profile* profile); | 280 GURL GetNewTabPageURL(Profile* profile); |
303 | 281 |
304 } // namespace chrome | 282 } // namespace chrome |
305 | 283 |
306 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 284 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
OLD | NEW |