Chromium Code Reviews| 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_ENABLED, |
| 54 ORIGIN_CHIP_TRAILING_LOCATION_BAR, | 54 ORIGIN_CHIP_UNUSED_PLACEHOLDER, // In list to avoid changing fieldtrial vals |
|
Justin Donnelly
2014/05/13 22:19:33
Per Alexei's comment, I think this is unnecessary.
Peter Kasting
2014/05/14 00:28:11
After some more discussions with David, I think I
Justin Donnelly
2014/05/14 16:31:43
I was concerned that we wouldn't be able to transp
| |
| 55 ORIGIN_CHIP_LEADING_MENU_BUTTON, | 55 ORIGIN_CHIP_ON_SRP, |
| 56 ORIGIN_CHIP_NUM_VALUES, | 56 ORIGIN_CHIP_NUM_VALUES, |
| 57 }; | 57 }; |
| 58 | 58 |
| 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 | 59 // Use this value for "start margin" to prevent the "es_sm" parameter from |
| 68 // being used. | 60 // being used. |
| 69 extern const int kDisableStartMargin; | 61 extern const int kDisableStartMargin; |
| 70 | 62 |
| 71 // Returns whether the Instant Extended API is enabled. | 63 // Returns whether the Instant Extended API is enabled. |
| 72 bool IsInstantExtendedAPIEnabled(); | 64 bool IsInstantExtendedAPIEnabled(); |
| 73 | 65 |
| 74 // Returns whether the suggest is enabled for the given |profile|. | 66 // Returns whether the suggest is enabled for the given |profile|. |
| 75 bool IsSuggestPrefEnabled(Profile* profile); | 67 bool IsSuggestPrefEnabled(Profile* profile); |
| 76 | 68 |
| (...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 | 179 // 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. | 180 // match. See comments on ShouldHideTopMatch in autocomplete_result.h. |
| 189 bool ShouldHideTopVerbatimMatch(); | 181 bool ShouldHideTopVerbatimMatch(); |
| 190 | 182 |
| 191 // Returns when we should show a search button in the omnibox. This may be any | 183 // 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 | 184 // 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 | 185 // the page would normally be to perform search term replacement; see also |
| 194 // ToolbarModel::WouldPerformSearchTermReplacement(). | 186 // ToolbarModel::WouldPerformSearchTermReplacement(). |
| 195 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); | 187 DisplaySearchButtonConditions GetDisplaySearchButtonConditions(); |
| 196 | 188 |
| 197 // Returns true if the origin chip should be shown in the toolbar. This | 189 // 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(); | 190 bool ShouldDisplayOriginChip(); |
| 201 | 191 |
| 202 // Returns a value indicating where the origin chip should be positioned on the | 192 // Returns a value indicating what event should trigger hiding the origin chip. |
|
Justin Donnelly
2014/05/13 22:19:33
"What event should trigger hiding" is no longer ac
Peter Kasting
2014/05/14 00:28:11
Technically, it was already inaccurate before my c
Justin Donnelly
2014/05/14 16:31:43
Looks good to me. But now we'll need to update th
Peter Kasting
2014/05/14 22:55:34
Ah, good catch. Fixed.
| |
| 203 // toolbar. | 193 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 | 194 |
| 216 // Returns true if the local new tab page should show a Google logo and search | 195 // 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. | 196 // box for users whose default search provider is Google, or false if not. |
| 218 bool ShouldShowGoogleLocalNTP(); | 197 bool ShouldShowGoogleLocalNTP(); |
| 219 | 198 |
| 220 // Transforms the input |url| into its "effective URL". The returned URL | 199 // Transforms the input |url| into its "effective URL". The returned URL |
| 221 // facilitates grouping process-per-site. The |url| is transformed, for | 200 // facilitates grouping process-per-site. The |url| is transformed, for |
| 222 // example, from | 201 // example, from |
| 223 // | 202 // |
| 224 // https://www.google.com/search?espv=1&q=tractors | 203 // 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, | 276 bool GetBoolValueForFlagWithDefault(const std::string& flag, |
| 298 bool default_value, | 277 bool default_value, |
| 299 const FieldTrialFlags& flags); | 278 const FieldTrialFlags& flags); |
| 300 | 279 |
| 301 // Returns the Cacheable New Tab Page URL for the given |profile|. | 280 // Returns the Cacheable New Tab Page URL for the given |profile|. |
| 302 GURL GetNewTabPageURL(Profile* profile); | 281 GURL GetNewTabPageURL(Profile* profile); |
| 303 | 282 |
| 304 } // namespace chrome | 283 } // namespace chrome |
| 305 | 284 |
| 306 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ | 285 #endif // CHROME_BROWSER_SEARCH_SEARCH_H_ |
| OLD | NEW |