| 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_COMMON_SEARCH_SEARCH_TYPES_H_ | 5 #ifndef CHROME_COMMON_SEARCH_SEARCH_TYPES_H_ |
| 6 #define CHROME_COMMON_SEARCH_SEARCH_TYPES_H_ | 6 #define CHROME_COMMON_SEARCH_SEARCH_TYPES_H_ |
| 7 | 7 |
| 8 // The Mode structure encodes the visual states encountered when interacting | 8 // The Mode structure encodes the visual states encountered when interacting |
| 9 // with the NTP and the Omnibox. | 9 // with the NTP and the Omnibox. |
| 10 struct SearchMode { | 10 struct SearchMode { |
| 11 // The visual state that applies to the current interaction. | 11 // The visual state that applies to the current interaction. |
| 12 enum Type { | 12 enum Type { |
| 13 // The default state means anything but the following states. | 13 // The default state means anything but the following states. |
| 14 MODE_DEFAULT, | 14 MODE_DEFAULT, |
| 15 | 15 |
| 16 // On the NTP page and the NTP is ready to be displayed. | 16 // On the NTP, and the user has *not* typed anything into the Omnibox. |
| 17 MODE_NTP, | 17 MODE_NTP, |
| 18 | 18 |
| 19 // The Omnibox is modified in some way, either on the NTP or not. | 19 // The Omnibox is modified in some way, either on the NTP or not. |
| 20 // TODO(treib): Get rid of this. It's only used to detect the "input in |
| 21 // progress" state for the NTP, which should be done in a less roundabout |
| 22 // way. crbug.com/627747 |
| 20 MODE_SEARCH_SUGGESTIONS, | 23 MODE_SEARCH_SUGGESTIONS, |
| 21 }; | 24 }; |
| 22 | 25 |
| 23 // The kind of page from which the user initiated the current search. | 26 // The kind of page from which the user initiated the current search. |
| 24 enum Origin { | 27 enum Origin { |
| 25 // The user is searching from some random page. | 28 // The user is searching from some random page. |
| 26 ORIGIN_DEFAULT = 0, | 29 ORIGIN_DEFAULT = 0, |
| 27 | 30 |
| 28 // The user is searching from the NTP. | 31 // The user is searching from the NTP. |
| 29 ORIGIN_NTP, | 32 ORIGIN_NTP, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 66 |
| 64 bool is_origin_ntp() const { | 67 bool is_origin_ntp() const { |
| 65 return origin == ORIGIN_NTP; | 68 return origin == ORIGIN_NTP; |
| 66 } | 69 } |
| 67 | 70 |
| 68 Type mode; | 71 Type mode; |
| 69 Origin origin; | 72 Origin origin; |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 #endif // CHROME_COMMON_SEARCH_SEARCH_TYPES_H_ | 75 #endif // CHROME_COMMON_SEARCH_SEARCH_TYPES_H_ |
| OLD | NEW |