| 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_TYPES_H_ | 5 #ifndef CHROME_COMMON_SEARCH_TYPES_H_ |
| 6 #define CHROME_COMMON_SEARCH_TYPES_H_ | 6 #define CHROME_COMMON_SEARCH_TYPES_H_ |
| 7 | 7 |
| 8 namespace chrome { | 8 namespace chrome { |
| 9 namespace search { | 9 namespace search { |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 Mode(Type in_mode, Origin in_origin) | 44 Mode(Type in_mode, Origin in_origin) |
| 45 : mode(in_mode), | 45 : mode(in_mode), |
| 46 origin(in_origin) { | 46 origin(in_origin) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 bool operator==(const Mode& rhs) const { | 49 bool operator==(const Mode& rhs) const { |
| 50 return mode == rhs.mode && origin == rhs.origin; | 50 return mode == rhs.mode && origin == rhs.origin; |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool operator!=(const Mode& rhs) const { |
| 54 return !(*this == rhs); |
| 55 } |
| 56 |
| 53 bool is_default() const { | 57 bool is_default() const { |
| 54 return mode == MODE_DEFAULT; | 58 return mode == MODE_DEFAULT; |
| 55 } | 59 } |
| 56 | 60 |
| 57 bool is_ntp() const { | 61 bool is_ntp() const { |
| 58 return mode == MODE_NTP; | 62 return mode == MODE_NTP; |
| 59 } | 63 } |
| 60 | 64 |
| 61 bool is_search() const { | 65 bool is_search() const { |
| 62 return mode == MODE_SEARCH_SUGGESTIONS || mode == MODE_SEARCH_RESULTS; | 66 return mode == MODE_SEARCH_SUGGESTIONS || mode == MODE_SEARCH_RESULTS; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 83 } | 87 } |
| 84 | 88 |
| 85 Type mode; | 89 Type mode; |
| 86 Origin origin; | 90 Origin origin; |
| 87 }; | 91 }; |
| 88 | 92 |
| 89 } // namespace search | 93 } // namespace search |
| 90 } // namespace chrome | 94 } // namespace chrome |
| 91 | 95 |
| 92 #endif // CHROME_COMMON_SEARCH_TYPES_H_ | 96 #endif // CHROME_COMMON_SEARCH_TYPES_H_ |
| OLD | NEW |